Hi, @vsr1 this query is taking more than 1 second, even though we have an index as suggested by CB, can you help with this ?
WITH instances AS (
SELECT instance.pageId,
*
FROMbucketName
AS instance
WHERE instance.type = ‘instance’
AND instance.clientId = “12345”
AND instance.id IN [“1213”,“11212”]) SELECT page,
i.instance AS instance,
META(i.instance).id AS _ID,
META(i.instance).cas AS _CAS
FROMbucketName
AS page
JOIN instances AS i ON page.pageId = i.pageId
WHERE page.type = ‘page’
AND page.clientId = “12345”
Indexes Used -
CREATE INDEX index_page_pageId ON
bucketName(
clientId,
pageId) WHERE (
type = 'page')