Re: Aggregate and many LEFT JOIN - Mailing list pgsql-performance

From Justin Pryzby
Subject Re: Aggregate and many LEFT JOIN
Date
Msg-id 20190226135134.GS28750@telsasoft.com
Whole thread Raw
In response to Re: Aggregate and many LEFT JOIN  (kimaidou <kimaidou@gmail.com>)
List pgsql-performance
On Tue, Feb 26, 2019 at 01:54:00PM +0100, kimaidou wrote:
> I manage to avoid the disk sort after performing a VACUUM ANALYSE;
> And with a session work_mem = '250MB'
> 
> * SQL http://paste.debian.net/1070207/
> * EXPLAIN https://explain.depesz.com/s/nJ2y
> 
> It stills spent 16s
> It seems this kind of query will need better hardware to scale...

Once you've exhausted other ideas, you could consider making that a TEMPORARY
TABLE, and creating an index on it (and analyzing it) and then aggregating.
It'd be several separate queries.

Justin


pgsql-performance by date:

Previous
From: kimaidou
Date:
Subject: Re: Aggregate and many LEFT JOIN
Next
From: Jeff Janes
Date:
Subject: Re: Aggregate and many LEFT JOIN