# 3.3 Database Index Setup

From the Firestore Database, Click on the **Indexes** tab and click on the **Add Index**. You have to create **five indexes** for the database.

> 1. Enter **reviews** as Collection ID, **course\_author\_id** into the first field and set **Ascending**, Enter **created\_at** in the second field and set **Descending,** Enter **\_\_name\_\_**  in the third field and set **Descending** and then select **Collection** as query scope and save it.
> 2. Enter **courses** as Collection ID, **cat\_id** into the first field and set **Ascending**, Enter **id** in the second field and set **Ascending,** Enter **\_\_name\_\_**  in the third field and set **Ascending** and then select **Collection** as query scope and save it.
> 3. Enter **courses** as Collection ID, **status** into the first field and set **Ascending**, Enter **created\_at** in the second field and set **Descending,** Enter **\_\_name\_\_**  in the third field and set **Descending** and then select **Collection** as query scope and save it.
> 4. Enter **reviews** as Collection ID, **course\_id** into the first field and set **Ascending**, Enter **created\_at** in the second field and set **Descending,** Enter **\_\_name\_\_**  in the third field and set **Descending** and then select **Collection** as query scope and save it.
> 5. Enter **courses** as Collection ID, **cat\_id** into the first field and set **Ascending**, Enter **status** in the second field and set **Ascending,** Enter **id**  in the third field and set **Ascending,** Enter **\_\_name\_\_** in the fourth field and set **Ascending** and then select **Collection** as query scope and save it.

This may take 3-5 minutes to activate. After completing this, your index page should look like this:

<figure><img src="https://3680394644-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyaJJT5ZOPh9eibDKGSOc%2Fuploads%2Fjenr7RmeQOdpWI1XZUFd%2FScreenshot%202023-12-23%20at%202.59.37%20PM.png?alt=media&#x26;token=53877db7-2d60-43d2-99f3-a356bff3dad4" alt=""><figcaption></figcaption></figure>
