Re: Parallel Aggregate

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: James Sewell <james(dot)sewell(at)lisasoft(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parallel Aggregate
Date: 2016-03-14 01:30:35
Message-ID: CAKJS1f_xMRhzSkSaH4BzSyEpayZNb8-DL3Ji-ZWnxtkdfHYEqQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 14 March 2016 at 14:16, James Sewell <james(dot)sewell(at)lisasoft(dot)com> wrote:

> I've done some testing with one of my data sets in an 8VPU virtual
> environment and this is looking really, really good.
>
> My test query is:
>
> SELECT pageview, sum(pageview_count)
> FROM fact_agg_2015_12
> GROUP BY date_trunc('DAY'::text, pageview);
>
> The query returns 15 rows. The fact_agg table is 5398MB and holds around
> 25 million records.
>
> Explain with a max_parallel_degree of 8 tells me that the query will only
> use 6 background workers. I have no indexes on the table currently.
>
> Finalize HashAggregate (cost=810142.42..810882.62 rows=59216 width=16)
> Group Key: (date_trunc('DAY'::text, pageview))
> -> Gather (cost=765878.46..808069.86 rows=414512 width=16)
> Number of Workers: 6
> -> Partial HashAggregate (cost=764878.46..765618.66 rows=59216
> width=16)
> Group Key: date_trunc('DAY'::text, pageview)
> -> Parallel Seq Scan on fact_agg_2015_12
> (cost=0.00..743769.76 rows=4221741 width=12)
>

Great! Thanks for testing this.

If you run EXPLAIN ANALYZE on this with the 6 workers, does the actual
number of Gather rows come out at 105? I'd just like to get an idea of my
cost estimate for the Gather are going to be accurate for real world data
sets.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kouhei Kaigai 2016-03-14 01:43:59 Re: WIP: Upper planner pathification
Previous Message James Sewell 2016-03-14 01:16:44 Re: Parallel Aggregate