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!