Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: =?WINDOWS-1...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 4060 of 4294
Post > Topic >>

Re: =?WINDOWS-1252?Q?Re:_Re:__Re:_Query_Opti?= =?WINDOWS-1252?Q?mization_with_Kruskal=92s_Algorithm?=

by tgl@[EMAIL PROTECTED] (Tom Lane) May 10, 2008 at 08:30 PM

"Jonah H. Harris" <jonah.harris@[EMAIL PROTECTED]
> writes:
> Wikipedia has the algorithm itself
> (http://en.wikipedia.org/wiki/Kruskal's_algorithm),
but I was more
> interested in the actual applicability to PG and any issues they ran
> into.

Hmm ... minimum spanning tree of a graph, eh?  Right offhand I'd say
this is a pretty terrible model of the join order planning problem.
The difficulty with trying to represent join order as a weighted
graph is that it assumes the cost to join two relations (ie, the
weight on the arc between them) is independent of what else you have
joined first.  Which is clearly utterly wrong for join planning.

Our GEQO optimizer has a similar issue --- it uses a search algorithm
that is designed to solve traveling-salesman, which is almost the same
thing as minimum spanning tree.  The saving grace for GEQO is that its
TSP orientation is only driving a heuristic; when it considers a given
overall join order it is at least capable of computing the right cost.
It looks to me like Kruskal's algorithm is entirely dependent on the
assumption that minimizing the sum of some predetermined pairwise costs
gives the correct plan.

In short, I'm sure it's pretty fast compared to either of our current
join planning methods, but I'll bet a lot that it often picks a much
worse plan.  Color me unexcited, unless they've found some novel way
of defining the graph representation that avoids this problem.

			regards, tom lane

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 8 Posts in Topic:
=?WINDOWS-1252?Q?Query_Optimization_with_Kruskal=92s_Algorithm?=
tarcizioab@[EMAIL PROTECT  2008-05-07 13:28:04 
=?UTF-8?Q?Re:__Query_Optimiza?= =?UTF-8?Q?tion_with_Kruskal=E2=8
alex@[EMAIL PROTECTED] (  2008-05-07 22:09:30 
=?windows-1252?Q?Re=3A_Query_Optimization_with_Kruskal=92s_Algor
Rauan Maemirov <rauan1  2008-05-10 10:31:22 
=?WINDOWS-1252?Q?Re:__Re:_Query_Optimization_with_Krusk?=
grzm@[EMAIL PROTECTED] (  2008-05-10 14:26:51 
=?WINDOWS-1252?Q?Re:__Re:_Query_Optimi?= =?WINDOWS-1252?Q?zation
jonah.harris@[EMAIL PROTE  2008-05-10 16:27:12 
Re: =?WINDOWS-1252?Q?Re:__Re:_Query_Optimi?= =?WINDOWS-1252?Q?za
tgl@[EMAIL PROTECTED] (T  2008-05-10 17:12:22 
=?WINDOWS-1252?Q?Re:_Re:__Re:_Query_Opti?= =?WINDOWS-1252?Q?miza
jonah.harris@[EMAIL PROTE  2008-05-10 17:17:21 
Re: =?WINDOWS-1252?Q?Re:_Re:__Re:_Query_Opti?= =?WINDOWS-1252?Q?
tgl@[EMAIL PROTECTED] (T  2008-05-10 20:30:39 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 15:42:27 CDT 2008.