Answer the question
In order to leave comments, you need to log in
PostgreSQL - why does the index not work on 50000 records?
Greetings, dear connoisseurs!!!
Such a situation: there is a table foo with columns id, active, field_id1, field_id2 and there is a composite index foo_field_id1_active with fields field_id1, acitve. Query for 10,000 records
EXPLAIN SELECT * FROM foo WHERE filed_id1=4444 AND active=1
Indicates that the index is in use, but at 50,000 records it is no longer used even after VACUUM ANALIZE foo;
About 1,000,000 records, I generally keep quiet.
And so the question is: which artist, the index is no longer used?
Answer the question
In order to leave comments, you need to log in
Postgresql considered that seq scan would be faster.
Why don't they use my indexes?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question