Re: small database huge planning time

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Alexander Kulikov <a-kulikov(at)hotmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: small database huge planning time
Date: 2026-01-13 09:29:45
Message-ID: 4f462695-5716-408a-a08a-8ba5e665bb9a@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 13/1/26 10:16, Alexander Kulikov wrote:
> Hello!
>
>
> I have got huge planning time for a query in quite small database in PortgreSQL 17
> Planning Time: 452.796 ms
> Execution Time: 0.350 ms
>
> Tried several version from 17.3 to 17.7 (cpu 2.2GHz) - it almost does not matter. If I run query many times in row planning time may reduce down to 430ms but never less.
>
> Tried in PortgreSQL 11 (in a little bit different hardware with cpu 2.60GHz) - planning time almost ten times less.
>
> Changing parameters: from_collapse_limit, join_collapse_limit, geqo, jit, work_mem and many
> others does not help at all. I attach 1. additional setting in the
> postgresql.status.conf. 2. querry itself in query.sql. 3. zql plan in
> query.sqlplan 4. additioanal information about os, tables etc. would you

May you attach the same EXPLAIN for the 'good' execution? Is there any
chance to get the schema definition as a SQL script (ideally,
without/replaced mvarchar fields)? Is it reproducible on a database with
empty tables?

--
regards, Andrei Lepikhov,
pgEdge

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Sabino Mullane 2026-01-13 14:44:49 Re: small database huge planning time
Previous Message Alexander Kulikov 2026-01-13 09:16:08 small database huge planning time