Re: [HACKERS] slower merge join on sorted data chosen over nested loop

2005-10-17 Thread Jim C. Nasby
On Mon, Oct 10, 2005 at 09:10:38PM -0400, Tom Lane wrote: > I recall thinking about changing the formula to more accurately count > the number of pages touched; but I desisted when I realized that it > would drastically increase the cost estimates for index searches, and > that's surely the wrong d

Re: [HACKERS] slower merge join on sorted data chosen over nested loop

2005-10-10 Thread Tom Lane
"Kevin Grittner" <[EMAIL PROTECTED]> writes: > A couple questions occur to me, though. I'm not clear on why > ceil is called -- do we need to eliminate the fraction here? Well, you don't get to read part of a page. In particular, fetching 1.0 index tuples requires fetching 1.0 pages, not (say) 0

Re: [HACKERS] slower merge join on sorted data chosen over nested loop

2005-10-10 Thread Tom Lane
"Kevin Grittner" <[EMAIL PROTECTED]> writes: > Tom Lane <[EMAIL PROTECTED]> 10/06/05 9:28 PM >>> >> There's a known issue that the planner tends to overestimate the cost of >> inner-index-scan nestloops, because it doesn't allow for the strong >> caching effects associated with repeated scans of th

Re: [HACKERS] slower merge join on sorted data chosen over nested loop

2005-10-06 Thread Tom Lane
"Kevin Grittner" <[EMAIL PROTECTED]> writes: > In both the 8.1beta2 and using a build from this morning's > dev snapshot, this query ran slower than expected: There's a known issue that the planner tends to overestimate the cost of inner-index-scan nestloops, because it doesn't allow for the stron

[HACKERS] slower merge join on sorted data chosen over nested loop

2005-10-06 Thread Kevin Grittner
In both the 8.1beta2 and using a build from this morning's dev snapshot, this query ran slower than expected: select count(*) from "DbTranRepository" AS "dtr" inner join "DbTranLogRecord" AS "dtlr" on ("dtlr"."countyNo" = "dtr"."countyNo" and "dtlr"."tranImageSeqNo" = "dt