[GENERAL] Performance cost of a sort-merge join

2010-02-22 Thread Yang Zhang
Hi, I have the given tables and query, but I'm confused why the cost of the query is so high. I've left it running over night. By comparison, a select * from metarelcloud_transactionlog order by transactionid takes on the order of seconds/minutes (at least in MySQL). As far as I can tell, the

Re: [GENERAL] Performance cost of a sort-merge join

2010-02-22 Thread Tom Lane
Yang Zhang yanghates...@gmail.com writes: Hi, I have the given tables and query, but I'm confused why the cost of the query is so high. The reason the estimated cost is so high is that the estimated number of rows out of the join is enormous. It's going to take awhile. One question worth

Re: [GENERAL] Performance cost of a sort-merge join

2010-02-22 Thread Yang Zhang
On Mon, Feb 22, 2010 at 12:10 PM, Tom Lane t...@sss.pgh.pa.us wrote: I've left it running over night. By comparison, a select * from metarelcloud_transactionlog order by transactionid takes on the order of seconds/minutes (at least in MySQL). That's got approximately nothing to do with this