parameterized limit statements
От | Merlin Moncure |
---|---|
Тема | parameterized limit statements |
Дата | |
Msg-id | 6EE64EF3AB31D5448D0007DD34EEB3417DD7EC@Herge.rcsinc.local обсуждение исходный текст |
Ответы |
Re: parameterized limit statements
|
Список | pgsql-hackers |
I noticed your 8/18 commit to address an issue I raised regarding parameterized limit statements. Specifically, prepared statements with a variable limit would tend to revert to bitmap or seqscan. I check out cvs tip and am still getting that behavior :(. So, I had a look at createplan.c to see what was going on. Inside makelimit, there is: if (count_est != 0) {double count_rows; if (count_est > 0) count_rows = (double) count_est;else count_rows = clamp_row_est(lefttree->plan_rows * 0.10);if (count_rows> plan->plan_rows) count_rows = plan->plan_rows;if (plan->plan_rows > 0) plan->total_cost = plan->startup_cost+ (plan->total_cost - plan->startup_cost) * count_rows / plan->plan_rows;plan->plan_rows= count_rows;if (plan->plan_rows < 1) plan->plan_rows = 1; } Is this correct? plan_rows is assigned (from count_rows) after it is checked to determine cost. If this is correct, would you like a test cast demonstrating the behavior? Merlin
В списке pgsql-hackers по дате отправления: