public inbox for [email protected]
help / color / mirror / Atom feedFrom: Jean-Christophe BOGGIO <[email protected]>
To: David Rowley <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Why isn't PG using an index-only scan?
Date: Thu, 18 Sep 2025 09:45:13 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAApHDvoUdvw68oHnfACQE=u8XPJ+Te49dZsfC2yW+DVfzdT2+Q@mail.gmail.com>
References: <[email protected]>
<CAApHDvoUdvw68oHnfACQE=u8XPJ+Te49dZsfC2yW+DVfzdT2+Q@mail.gmail.com>
Thanks David,
Le 18/09/2025 à 09:20, David Rowley a écrit :
> Yes. Since *all* records of "oeu" are required and they're not
> required in any particular order, then Seq Scan should be the fastest
> way to access those records.
Ok but then why is it doing it on the AD table? Is it because of the
number of rows?
> 5 hours seems very slow for the estimated number of records. Have you
> tried running the SELECT using EXPLAIN ANALYZE without the INSERT
> part? Even if the 84 million Merge Join row estimate is accurate, 5
> hours seems excessively long.
I tried this, it took 1 second. And then I discovered that I had an old
trigger on the copyrightad table.
The insert took 2 seconds.
Very sorry for wasting your time and thanks again for putting me on the
right track.
Have a great day!
view thread (9+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Why isn't PG using an index-only scan?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox