Re: [druid-user] WHERE IN (sub-queries) with lookup dataset is slow


select * ,lookup(dimension,‘lkp1’) v from datasource where v=

It is best to avoid a subquery if you are looking for response of 1 s or less.


weird…but the following works and is essentially the same query

select * from datasource where lookup(dimension_in_datasource, “lookupName”) =’’

I’m not sure why the alias (v) doesn’t work, but isn’t using LOOKUP the wrong logic? We want to search on v, not k.

I think you might be better off using two queries, as you suggested.

Lookup is using the right logic. The lookup is retrieving v for k and hence the filter is on v.