Re: Predicting query runtime

From: Istvan Soos <istvan(dot)soos(at)gmail(dot)com>
To: Vinicius Segalin <vinisegalin(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Predicting query runtime
Date: 2016-09-12 21:22:52
Message-ID: CALdQGgutrOvdrhdrK132=j8JDjcynq08+14k60DGaQRQZ16fng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Vinicius,

At Heap we have non-trivial complexity in our analytical queries, and
some of them can take a long time to complete. We did analyze features
like the query planner's output, our query properties (type,
parameters, complexity) and tried to automatically identify factors
that contribute the most into the total query time. It turns out that
you don't need to use machine learning for the basics, but at this
point we were not aiming for predictions yet.

As a spoiler: queries take long time because they do a lot of IO.
Features like reachback depth and duration (e.g. what period is the
analytical query about) can contribute a lot to the amount of IO,
thus, the query time. I have a blog post in my queue about our
analysis, would gladly bump its priority if there is interest in such
details.

I'm also curious: if you had a great way to predict the time/cost of
the queries, how would you use it?

Best regards,
Istvan

On Mon, Sep 12, 2016 at 4:03 PM, Vinicius Segalin <vinisegalin(at)gmail(dot)com> wrote:
> Hi everyone,
>
> I'm trying to find a way to predict query runtime (I don't need to be
> extremely precise). I've been reading some papers about it, and people are
> using machine learning to do so. For the feature vector, they use what the
> DBMS's query planner provide, such as operators and their cost. The thing is
> that I haven't found any work using PostgreSQL, so I'm struggling to adapt
> it.
> My question is if anyone is aware of a work that uses machine learning and
> PostgreSQL to predict query runtime, or maybe some other method to perform
> this.
>
> Thank you.
>
> Best regards,
>
> Vinicius Segalin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lee Hachadoorian 2016-09-12 21:35:22 Re: Replication Recommendation
Previous Message Adrian Klaver 2016-09-12 21:12:14 Re: Replication Recommendation