Re: Why isn't PG using an index-only scan? - Mailing list pgsql-performance

From Jean-Christophe BOGGIO
Subject Re: Why isn't PG using an index-only scan?
Date
Msg-id 63d65775-0130-4c5c-a151-8d7728b6d4e8@thefreecat.org
Whole thread Raw
In response to Re: Why isn't PG using an index-only scan?  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Why isn't PG using an index-only scan?
List pgsql-performance
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!



pgsql-performance by date:

Previous
From: David Rowley
Date:
Subject: Re: Why isn't PG using an index-only scan?
Next
From: Andrei Lepikhov
Date:
Subject: Re: Why isn't PG using an index-only scan?