Join query very slow

Hi, i have a join query that ho very slow. I use the key for join but query continue to use 5 second.

SELECT * FROM bucket doc_type1 JOIN bucket doc_type2 ON KEYS doc_type1.customer WHERE doc_type2._key=‘RESEARCHKEY’;

I try to create an index:
CREATE INDEX idx_profile ON bucket(doc_type1,doc_type2);
and
CREATE INDEX idx_profile ON bucket(doc_type1.customer,doc_type2._key);
and separate index for another type of document but continue to go slow. Where am i wrong?

Thanks,
J

Hi,

We are fixing this issue so that the query can use an index on doc_type2._key. For now, is there any way you can index and filter your query using an attribute of doc_type1?

1 Like

Fantastic!
I resolved, i’ve added in WHERE clause 'AND doc_type2._key=‘RESEARCHKEY’ now it’s very fast.

Thanks,
J

We are fixing this issue so that the query can use an index on doc_type2._key.

Is there any progress with this issue? What version may contain a resolution of this issue?

Hi @Tolyasik,

Please see my last answer in this thread:

Joining two buckets backwards