pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Arthur Ramsey <arthur.ramsey@code42.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Table scan on 15.2
Date: Wed, 15 Mar 2023 12:18:07 -0400
Message-ID: <3340032.1678897087@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEJqy4UW=uo3z0NTU=ukTwKoUMSg1ViAWmwfA2BZ70vQ+TSY4w@mail.gmail.com>
References: <CAEJqy4WBz=C67tJ4Sjq_T0yTwO0b7_ye34xVY7cxrSDXqnucjg@mail.gmail.com>
	<3337979.1678896202@sss.pgh.pa.us>
	<CAEJqy4UW=uo3z0NTU=ukTwKoUMSg1ViAWmwfA2BZ70vQ+TSY4w@mail.gmail.com>

Arthur Ramsey <arthur.ramsey@code42.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





view thread (8+ messages)  latest in thread

Message-ID: <3340032.1678897087@sss.pgh.pa.us>
Permalink:  ../3340032.1678897087@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3340032.1678897087@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, arthur.ramsey@code42.com
  Subject: Re: Table scan on 15.2
  In-Reply-To: <3340032.1678897087@sss.pgh.pa.us>
  References: <CAEJqy4WBz=C67tJ4Sjq_T0yTwO0b7_ye34xVY7cxrSDXqnucjg@mail.gmail.com> <3337979.1678896202@sss.pgh.pa.us> <CAEJqy4UW=uo3z0NTU=ukTwKoUMSg1ViAWmwfA2BZ70vQ+TSY4w@mail.gmail.com> <3340032.1678897087@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox