Re: Bitmap Heap Scan taking ~60x as long for table when queried as partition

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Stephen Froehlich <s(dot)froehlich(at)cablelabs(dot)com>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Bitmap Heap Scan taking ~60x as long for table when queried as partition
Date: 2018-02-15 06:00:02
Message-ID: 1518674402.2380.5.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Stephen Froehlich wrote:
> It took me until this morning to get the EXPLAIN ANALYZE running. Note that it is a
> fair amount slower today because I'm in the midst of a pg_dump for the database
> in question, but the proportions should be there:

That query has to scan all 122 partitions to get its result.
This cannot be avoided, because there are matching rows in
many partitions.
Partitioning doesn't help if all partitions have to be scanned.

I notice that there is no parallelization - having several
workers scan partitions in parallel should help.

You could create a combined index on (client_ip_md5, start_time),
that might speed up the index scans.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Stephen Froehlich 2018-02-15 15:55:02 RE: Bitmap Heap Scan taking ~60x as long for table when queried as partition
Previous Message Stephen Froehlich 2018-02-14 21:59:37 RE: WAL settings