Re: Table scan on 15.2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Arthur Ramsey <arthur(dot)ramsey(at)code42(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Table scan on 15.2
Date: 2023-03-15 16:18:07
Message-ID: 3340032.1678897087@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Arthur Ramsey <arthur(dot)ramsey(at)code42(dot)com> writes:
> After a restart and seq disabled for session with no other load (same for
> plan with seq enabled).

> Bitmap Heap Scan on t_user user0_ (cost=19567.17..58623.03 rows=800678
> width=761) (actual time=0.370..0.702 rows=36 loops=1)

So the problem is that awful rowcount estimate. (I see that v12's
estimate wasn't exactly spot-on either, but it wasn't so bad as to
push the planner to use a seqscan.) Hard to form an opinion on the
cause of that when you've redacted all the details of the index
condition, unfortunately.

It could be that increasing the table's statistics target and
re-ANALYZEing would help.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arthur Ramsey 2023-03-15 16:24:25 Re: Table scan on 15.2
Previous Message Tom Lane 2023-03-15 16:12:23 Re: How to behive if I remove password from postgres role