Re: Timestamp conversion can't use index
От | Tom Lane |
---|---|
Тема | Re: Timestamp conversion can't use index |
Дата | |
Msg-id | 19662.1009381749@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Timestamp conversion can't use index (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | pgsql-hackers |
Bruce Momjian <pgman@candle.pha.pa.us> writes: > What has me confused is why constant folding is needed to perform index > lookups. You are confused because those aren't related. The entire notion of an indexscan is predicated on the assumption that you are comparing all elements of the index to the same comparison value. Thus for example "x = random()" is not indexable. To use an indexscan the query planner must be able to determine that the right hand side will not change over the course of the scan. Constant-folding requires a stronger assumption: that the result the function gives when evaluated by the query planner will be the same result we'd get later (perhaps much later) at execution time. Since we only have one kind of noncachable function at the moment, these two restrictions are conflated ... but there should be more than one kind of noncachable function. regards, tom lane
В списке pgsql-hackers по дате отправления: