Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0E292476D44 for ; Thu, 2 Jan 2003 16:21:55 -0500 (EST) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by postgresql.org (Postfix) with ESMTP id 95A34476CD8 for ; Thu, 2 Jan 2003 16:21:27 -0500 (EST) Received: from samurai.com (localhost [127.0.0.1]) by bob.samurai.com (Postfix) with SMTP id BEB511F2C; Thu, 2 Jan 2003 16:21:28 -0500 (EST) Received: from cpe00d0096a6cd5.cpe.net.cable.rogers.com ([24.112.166.30]) (SquirrelMail authenticated user neilc) by mailbox.samurai.com with HTTP; Thu, 2 Jan 2003 16:21:28 -0500 (EST) Message-ID: <1477.24.112.166.30.1041542488.squirrel@mailbox.samurai.com> Date: Thu, 2 Jan 2003 16:21:28 -0500 (EST) Subject: Re: join over 12 tables takes 3 secs to plan From: "Neil Conway" To: In-Reply-To: References: <3559.1041539060@sss.pgh.pa.us> X-Priority: 3 Importance: Normal Cc: , X-Mailer: SquirrelMail (version 1.2.9) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/13 X-Sequence-Number: 660 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