| From: | Israel Brewster <ijbrewster(at)alaska(dot)edu> |
|---|---|
| To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
| Cc: | PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: PostgreSQL 15-->18 slowdown? |
| Date: | 2026-06-26 18:19:06 |
| Message-ID: | 9FB992C2-0A1D-4BFE-8066-77F130471B9B@alaska.edu |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Jun 26, 2026, at 10:14 AM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>
>
>
> On 6/26/26 10:58 AM, Israel Brewster wrote:
>> In postgreSQL 15, I had the below query that worked quickly. Now, I make no claims that the query is the best possible, or even a good query, but it DID work, and it did so quickly enough to be un-noticable when running.
>> Then I upgrade to PostgreSQL 18 - and now the query never completes (as in, I get a command timeout after at least half an hour before I get a result). Looking at the EXPLAIN (https://explain.depesz.com/s/llAQ <https://explain.depesz.com/s/llAQ>) makes it pretty obvious why: we have a sequence scan on a large table inside a nested loop - and that sequence scan is apparently not short circuiting.
>
> The link provided shows no times or rows, did you pick the correct one?
>> I tried the obvious: REINDEX database and VACUUM ANALYZE, but neither helped. I have my default_statistics_target set to 500 at the moment.
>> Then I tried SET enable_seqscan = off; Lo and behold, the query ran in only 123.888 ms (fun number :-D ) - https://explain.depesz.com/s/K2K9 <https://explain.depesz.com/s/K2K9>
>
> This one does not show the actual query.
Right, sorry. It’s the same query as in the first one though. Only difference is sequence scan off.
---
Israel Brewster
Software Engineer
Alaska Volcano Observatory
Geophysical Institute - UAF
2156 Koyukuk Drive
Fairbanks AK 99775-7320
Work: 907-474-5172
cell: 907-328-9145
>
>
>> ---
>> Israel Brewster
>> Software Engineer
>> Alaska Volcano Observatory
>> Geophysical Institute - UAF
>> 2156 Koyukuk Drive
>> Fairbanks AK 99775-7320
>> Work: 907-474-5172
>> cell: 907-328-9145
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Adrian Klaver | 2026-06-26 18:40:09 | Re: PostgreSQL 15-->18 slowdown? |
| Previous Message | Adrian Klaver | 2026-06-26 18:16:23 | Re: PostgreSQL 15-->18 slowdown? |