Search Postgresql Archives

Re: Or selection on index versus union

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



han.holl@xxxxxxxxxxxxxxxxxxxx writes:

> PS We still have to be careful how to formulate conditions:
>
> where fase in ('1','2')
>
> is ok, and uses the index, but the logically identical:
>
> where position(fase in '12') >= 1
>
> does a sequential scan.

Right, you would need a functional index to fix that.  The query
optimizer, in general, doesn't know what specific functions
do--they're black boxes.  So there would be no way for the optimizer
to figure out that the two expressions mean the same thing.

-Doug

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux