Bug: Very poor query optimization by Postgres

From: Tobias Völk <tobias(dot)voelk(at)t-online(dot)de>
To: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Bug: Very poor query optimization by Postgres
Date: 2020-07-07 18:02:53
Message-ID: 1jsrvh-43XLjU0@fwd13.t-online.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello dear Postgres-Community,

First of all I’d like to thank you for providing and developing this amazingly fast database software for free!

Now to the bug:
I’ve installed the Postgres 12 Server for Windows 10 using the installer and created the tables using Java and JDBC.
The bug is that when I execute the query “select count(*) from table” in pgAdmin in the browser or through the PostgreSQL Viewer app from the Playstore, it takes a little while which is already strange and explain indeed tells me,
that Postgres is performing a sequential scan with 2 workers instead of just returning the number or rows!
This is very poor query optimization but very easy to fix on the other hand! As well as beneficial, since this kind
of query is used very often (also as a subquery).

Below is a screenshot of pgAdmin4’s output.

Regards Tobi

Attachment Content-Type Size
image/png 27.9 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-07-07 18:48:30 BUG #16529: Installation error/bug
Previous Message Amit Langote 2020-07-07 14:18:29 Re: posgres 12 bug (partitioned table)