Re: Postgres 11 chooses seq scan instead of index-only scan

2019-01-24 Thread Don Seiler
On Thu, Jan 24, 2019 at 9:01 AM twoflower wrote: > Yes! That was it, after running VACUUM TABLE history_translation, the > query is now executed using index-only scan. > > I was under the impression that ANALYZE TABLE history_translation is > enough, but it is not. > Only a VACUUM will update th

Re: Postgres 11 chooses seq scan instead of index-only scan

2019-01-24 Thread twoflower
Yes! That was it, after running VACUUM TABLE history_translation, the query is now executed using index-only scan. I was under the impression that ANALYZE TABLE history_translation is enough, but it is not. Thank you very much. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general

Re: Postgres 11 chooses seq scan instead of index-only scan

2019-01-24 Thread Tom Lane
twoflower writes: > One issue I cannot resolve is the new server using a parallel seq scan > instead of index-only scan for the following query: > select count(id) from history_translation You might need to vacuum the table to ensure that the planner thinks a reasonable proportion of the pages ar

Postgres 11 chooses seq scan instead of index-only scan

2019-01-24 Thread twoflower
I restored a dump of our production DB (running on 9.6) to a Postgres 11 server and wanted to run some basic benchmarks to see if there isn't some unexpected performance drop. One issue I cannot resolve is the new server using a parallel seq scan instead of index-only scan for the following query: