HI
Here is my query
SELECT
c.customer_id,
c.first_name,
c.last_name,
c.created_date,
c.status,
inv.referal_or_corp,
c.email,
c.address,
c.city,
c.zip_code,
c.state,
c.contact,
inv.store_id
from st_initialization_hq c
INNER JOIN st_data_bucket inv ON inv.cus_id = c.customer_id AND inv.type = ‘invoice’
WHERE c.type = ‘customer’ AND inv.date BETWEEN ‘2022-08-01’ AND ‘2022-08-31’
On couchbase index advisor suggested me these indexes
CREATE INDEX def_customer_1 ON st_initialization_hq
(type
,customer_id
,city
,state
,status
,contact
,zip_code
,created_date
,email
,address
,last_name
,first_name
)
CREATE INDEX def_customer_2 ON st_data_bucket
(type
,date
,cus_id
,referal_or_corp
,store_id
)
CREATE INDEX def_customer_3 ON st_data_bucket
(type
,date
,cus_id
)
I have around 550 docs in db but query takes aroud 27s to execute which is too slow i think
Kindly Help Thanks