Greg Stark <[EMAIL PROTECTED]> writes: > Tom Lane <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster