I have a bucketed table from which I want to query by multiple values. Here is an example:
SELECT *
FROM my_bucketed_table
WHERE bucketed_column IN (value1, value2)
The result is a full scan of the table, instead of using the index.
When I used union to query each value at a time it worked as expected in terms of data scanned:
SELECT *
FROM my_bucketed_table
WHERE bucketed_column = value1
UNION
SELECT *
FROM my_bucketed_table
WHERE bucketed_column = value2
but I want the list to be dynamic, so this solution is not good enough for me.
I expect the data scanned to be the same as in the UNION solution using the IN operator or a JOIN with another table