Re: join over 12 tables takes 3 secs to plan

Neil Conway <neilc@samurai.com>

From: "Neil Conway" <neilc@samurai.com>
To: <hlapp@gmx.net>
Cc: <tgl@sss.pgh.pa.us>, <pgsql-performance@postgresql.org>
Date: 2003-01-02T21:21:28Z
Lists: pgsql-performance
Hilmar Lapp said:
> As an added note, appreciating that query optimization is a difficult
> problem, and I do think PostgreSQL is a great product. Having said
> that, I've written 16-table joins for Oracle and always found them to
> plan within a second or two, so that's why I thought there's nothing
> special about the query I posted ... I'm not saying this to be bashful
> about PostgreSQL, but rather to suggest that apparently there are ways
> to do it pretty fast.

I'm sure there is room for improvement -- either by adding additional
heuristics to the default optimizer, by improving GEQO, or by implementing
another method for non-exhaustive search for large join queries (there are
several ways to handle large join queries, only one of which uses a
genetic algorithm: see "Query Optimization" (Ioannidis, 1996) for a good
introductory survey).

If you'd like to take a shot at improving it, let me know if I can be of
any assistance :-)

Cheers,

Neil