Re: Thousands of partitions performance questions - Mailing list pgsql-general

From David Rowley
Subject Re: Thousands of partitions performance questions
Date
Msg-id CAKJS1f_n7cZ0Jigejg6cog_DaPWUzTnbda+4_4LJt73WUq5GzQ@mail.gmail.com
Whole thread Raw
In response to Re: Thousands of partitions performance questions  (Shai Cantor <shaicantor@gmail.com>)
List pgsql-general
On Mon, 29 Apr 2019 at 19:20, Shai Cantor <shaicantor@gmail.com> wrote:
> Some notes I haven't shared or were not clear enough on the previous post.
>
> Data is inserted using the copy command only and in an offline manner. Meaning, no user action creates or updates the
data.An offline job runs is. Number of inserts can reach up to 1500 a day.
 
> Queries are only on a single partition
>
> Can that ease the performance?

Yes, COPY will be more efficient. In PG11 it still means locking all
partitions but that becomes more worthwhile the more tuples that are
inserted at once.  The same goes for INSERT with multiple rows in the
VALUES clause.

> Will querying directly the partition tables help?

Yes. If you're able to determine which partition to query from within
the application and write that in the query instead, then this will be
much less planner overhead for PG11. It'll be pretty much the same as
if you were querying a normal table.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



pgsql-general by date:

Previous
From: Shai Cantor
Date:
Subject: Re: Thousands of partitions performance questions
Next
From: Matthias Apitz
Date:
Subject: Re: Missing pg_config on SuSE SLES 12 for PostgreSQL 10