If this is still an issue after you check David's theory about premature
analyzing, another approach is to pre-populate and pre-analyze future
tables. Something like this:
* disable autovac on the future table
* detach the table from the main partition
* insert a few hundred thousand rows into it,
On Thu, 2025-12-18 at 13:48 -0500, Matthew Planchard wrote:
> In a table with high insert frequency (~1.5k rows/s) and high query
> frequency (~1k queries/s), partitioned by record creation time, we have
> observed the following behavior:
>
> * When the current time crosses a partition boundary, a
On Thu, Dec 18, 2025 at 3:21 PM David Rowley wrote:
> On Fri, 19 Dec 2025 at 08:55, Matthew Planchard
> wrote:
> > > How about just force seqscan off when the table is created?
> > > ALTER TABLE SET (enable_seqscan = off);
> >
> > I didn't know this could be set on the table level! Our partiti
On Fri, 19 Dec 2025 at 08:55, Matthew Planchard wrote:
> > How about just force seqscan off when the table is created?
> > ALTER TABLE SET (enable_seqscan = off);
>
> I didn't know this could be set on the table level! Our partitions are
> created by partman, but we have a nightly job that does
On Fri, 19 Dec 2025 at 07:48, Matthew Planchard wrote:
> * Because the planner's latest knowledge of the partition was based on
> its state prior to the cutover, it assumes the partition is empty and
> creates plans that use sequential scans
If the table/partition was just created and not ana
Thanks very much for the reply and the suggestions, a lot of good
stuff to look at.
> What's autovacuum_analyze_scale_factor set to? The default 20% is pretty
> high.
> autovacuum_naptime might need to be dropped, too.
This is just whatever the default is, so I will look into updating
these se
On Thu, Dec 18, 2025 at 1:48 PM Matthew Planchard
wrote:
>
> In a table with high insert frequency (~1.5k rows/s) and high query
> frequency (~1k queries/s), partitioned by record creation time, we have
> observed the following behavior:
>
> * When the current time crosses a partition boundary, a