Re: Query planner / Analyse statistics bad estimate rows=1 withmaximum statistics 10000 on PostgreSQL 10.2 - Mailing list pgsql-general

From Jeff Janes
Subject Re: Query planner / Analyse statistics bad estimate rows=1 withmaximum statistics 10000 on PostgreSQL 10.2
Date
Msg-id CAMkU=1xe=d66bz56mw0Zs8VNa1yh7rNpGQxzsrDidAyfCr+Pwg@mail.gmail.com
Whole thread Raw
In response to Query planner / Analyse statistics bad estimate rows=1 with maximumstatistics 10000 on PostgreSQL 10.2  (Mark <mwchambers@gmail.com>)
Responses Re: Query planner / Analyse statistics bad estimate rows=1 withmaximum statistics 10000 on PostgreSQL 10.2  (Mark <mwchambers@gmail.com>)
List pgsql-general

- Does the analyse output below mean that it only scanned 51538 of 65463 rows in the table? Is school_id 36 just being missed in the sample? (This happens when the analyse is repeated )

Is there a transaction which had deleted all of school_id=36, and then was just left open indefinitely without either committing or rolling back?

That would explain it, and I don't know of anything else that could.  The deleted but not committed tuples are still live, but don't get sampled.

Cheers,

Jeff

pgsql-general by date:

Previous
From: Rob Sargent
Date:
Subject: Re: Watching for view changes
Next
From: Mitar
Date:
Subject: Re: Watching for view changes