3 ms·
> it sounds like you don't have a single index that covers both columns. Yes. But other databases (SQLlite, etc.) select the correct index, without the need to
by zac23or 3y ago
> it sounds like you don't have a single index that covers both columns.
Yes. But other databases (SQLlite, etc.) select the correct index, without the need to create an index with both columns.
- franckpachot 3y agoIn all databases you will avoid bad plans (and the unpredictable performance related to plan changes) by providing the right index. You have two selective filters: WHERE and LIMIT so the right index have both
- franckpachot 3y agoMaybe it is not the planner. On difference between those other databases and PostgreSQL is that their plan do not depend on how freshly the table was vacuumed. The cost of your "correct index" may becomes worse when the rows are updated until they are vacuumed.