Jakub Ouhrabka <jouh8664(at)ss1000(dot)ms(dot)mff(dot)cuni(dot)cz> writes:
> can anyone explain me why there are different query plans for "select ...
> from ... where y!=x" and "select ... from ... where y<x or y>x" for
> integers, please?
!= isn't an indexable operation. This is not the planner's fault, but
a consequence of the index opclass design we inherited from Berkeley.
I suppose we could make it an indexable operation --- but there are so
few cases where it'd be a win that I'm not excited about it.
regards, tom lane