Answer the question
In order to leave comments, you need to log in
Why is an IN query in PostgreSQL DBMS much slower than a similar OR query?
Hello!
There is the following request:
SELECT * from table
WHERE column IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17)
ORDER BY ID DESC LIMIT 500 OFFSET 0
Answer the question
In order to leave comments, you need to log in
ORDER BY ID
select * from pg_stats where tablename = 'table' and attname = 'column'
because the execution plans are different. compare them and see the answer
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question