Re: Between Node
От | Tom Lane |
---|---|
Тема | Re: Between Node |
Дата | |
Msg-id | 8661.1027024818@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Between Node (Rod Taylor <rbt@zort.ca>) |
Список | pgsql-patches |
Rod Taylor <rbt@zort.ca> writes: >> In that case, this code is worse than before as far as developing plans >> goes. The selectivity estimator needs to be taught about what BETWEEN >> means. Currently it recognizes (x > foo AND x < bar) as a range query >> --- a BETWEEN node is obviously much easier to recognize, but you still >> have to add code to do it. > I simply multiple the results of the left, right and common expression > after sending them through clause_selectivity() ? Huh? I don't see any "common expression" here. You've got a left comparison and a right comparison. Actually, at least for the case of the standard asymmetric BETWEEN clause, you really really want to be able to generate a bounded indexscan plan (indexscan with x > foo AND x < bar as indexquals). That used to happen for free, and now will not happen at all, because BETWEEN is not in the set of operators recognized as indexscannable operators. Not sure what the most appropriate fix is --- there are a number of places that we could try to fix it at, with varying implications as to the amount of code changed and the generality of the cases handled. regards, tom lane
В списке pgsql-patches по дате отправления: