HI
My Query
SELECT
inv.date,
inv.id,
inv.store_id,
inv.description,
inv.cus_id,
inv.total_after_disc,
inv.total_bill,
inv.tax_amount_price,
inv.employee_id,
inv.account_type,
inv.invoice_taxes,
ins.service_id,
ins.service_name,
inst.department_id,
inst.department_name,
inst.item_id,
inst.item_qty,
inp.terminal_id
FROM st_data_bucket inv UNNEST inv.invoice_services AS ins
UNNEST ins.item_list AS inst
UNNEST inv.invoice_payment AS inp
WHERE inv.date between '2022-08-01' AND '2022-08-31'
AND inv.referal_or_corp = 'Walk in' AND inv.type = 'invoice'
Here i am getting data from 2 levels for the level 1 (invoice_services,invoice_payment) i created 2 indexes but for level 2 (ins.item_list) i dont know how to cover this in indexes
CREATE INDEX def_net_suite_ref_corp_3 ON `st_data_bucket`(ALL `invoice_services`,ALL `invoice_payment`,`type`,`referal_or_corp`,`date`,`store_id`,`total_bill`,`account_type`,`invoice_taxes`,`tax_amount_price`,`total_after_disc`,`id`,`cus_id`,`employee_id`,`description`)
WHERE type = "invoice"
CREATE INDEX def_net_suite_ref_corp_4 ON `st_data_bucket`(ALL `invoice_payment`) WHERE type = "invoice"
When i see explain in couchbase server these indexes are not covering properly