Re: GSoC idea - Simulated annealing to search for query plans - Mailing list pgsql-hackers

From Grzegorz Parka
Subject Re: GSoC idea - Simulated annealing to search for query plans
Date
Msg-id CAP1U9wGp1N=iKw9Rj=kmzU2Xa3KUEYgbKvk4uWc+FjRMqEEMsw@mail.gmail.com
Whole thread Raw
In response to Re: GSoC idea - Simulated annealing to search for query plans  (Jan Urbański <wulczer@wulczer.org>)
List pgsql-hackers
Thank you a lot for your feedback. I searched a lot about GEQO,
but I didn't find information about any earlier attempts.
I'm happy to know that this is important for Postgres.

I'm really interested in this project, so I just need to estimate if I can handle it.
Now I will spend some time with SAIO and GEQO to find it out.

Best,
Grzegorz

2015-02-27 16:29 GMT+01:00 Jan Urbański <wulczer@wulczer.org>:

Josh Berkus writes:

> On 02/26/2015 05:50 PM, Fabrízio de Royes Mello wrote:
>>
>> On Thu, Feb 26, 2015 at 10:27 PM, Andres Freund <andres@2ndquadrant.com
>> <mailto:andres@2ndquadrant.com>> wrote:
>>>
>>> On 2015-02-26 20:23:33 -0500, Tom Lane wrote:
>>> >
>>> > I seem to recall somebody demo'ing a simulated-annealing GEQO
>> replacement
>>> > at PGCon a couple years back.  It never got to the point of being a
>>> > submitted patch though.
>>>
>>> Yea, it was Jan Urbański (CCed).
>>>
>>
>> And the project link: https://github.com/wulczer/saio
>
> So what w'ere saying, Grzegorz, is that we would love to see someone
> pick this up and get it to the point of making it a feature as a GSOC
> project.  I think if you can start from where Jan left off, you could
> actually complete it.

Sorry, late to the party.

Yes, I wrote a GEQO replacement that used simulated annealing for my Master
thesis. It got to a point where it was generating plans similar to what GEQO
outputs for small queries and better plans for very large ones.

The thesis itself is here: https://wulczer.org/saio.pdf and the linked GitHub
repo contains source for the PGCon presentation, which gives a higher-level
overview.

The big problem turned out to be writing the step function that generates a new
join order from a previous one. Look for the "Simulated Annealing challenges"
and "Moves generator" chapters in my thesis, which are the only interesting
ones :)

If you'd like to pick up where I left, I'd be more than happy to help in any
ways I can.

Best,
Jan

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Enforce creation of destination folders for source files in pg_regress (Was: pg_regress writes into source tree)
Next
From: Josh Berkus
Date:
Subject: Looking for Intro to Hacking teacher for pgCon