Re: Does anybody use ORDER BY x USING y?
От | Tom Lane |
---|---|
Тема | Re: Does anybody use ORDER BY x USING y? |
Дата | |
Msg-id | 18053.1127100868@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Does anybody use ORDER BY x USING y? (Greg Stark <gsstark@mit.edu>) |
Ответы |
Re: Does anybody use ORDER BY x USING y?
|
Список | pgsql-hackers |
Greg Stark <gsstark@mit.edu> writes: > Tom Lane <tgl@sss.pgh.pa.us> writes: >> That would be an extremely bad idea, because it would immediately remove >> index scans as one way to meet an ORDER BY. > Well couldn't the index scan be taught to go fetch the NULLs in a separate > traversal? (1) IS NULL is not an indexable operation, so no, not without significant overhaul of the index AM API. (2) This propagates a problem that is specific to orderable indexes (ie btree) into code that is generic to all indexes, and thus creates the problem of how do you deal with specifying NULL ordering without any definition of ordering for non-NULLs. (3) You still have to invent a mechanism to define whether you want nulls first or last ... and make sure that that mechanism works for plans that use explicit SORT steps as well as those that use index scans. regards, tom lane
В списке pgsql-hackers по дате отправления: