Time bucketing query performance - Mailing list pgsql-performance

From Julian Wilson
Subject Time bucketing query performance
Date
Msg-id CAPP28tKsOwnJKDS7i+W5hdO26_F+tm5fGxeDQ9rzuCf9YF=38A@mail.gmail.com
Whole thread Raw
Responses Re: Time bucketing query performance  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-performance
Hi,

I'm trying to debug improve the performance of my time bucketing query. What I'm trying to do is essentially bucket by an arbitrary interval and then do some aggregations within that interval (min,max,sum, etc). I am using a `max` in the query I posted. For context in the data, it is 1 minute candles of cryptocurrency data (open price, high price, low price, close price, volume, for an interval). I want to transform this to a 10 minute interval, on demand, and that is what this query is meant to do. 

I understand the slow part of my query is in the LEFT JOIN, but I just can't quite figure out how to do it without the LEFT JOIN.

Here is my pastebin with all the details so I don't clutter the message. I tried to follow everything in the 'Slow Query Questions' WIKI page. There is also a depesz link there. 


Thank for your help,

Julian


pgsql-performance by date:

Previous
From: David Rowley
Date:
Subject: Re: help in analysis of execution plans
Next
From: Justin Pryzby
Date:
Subject: Re: Time bucketing query performance