Re: Performance of IN (...) vs. = ANY array[...]

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

 



Benjamin Minshall <minshall@xxxxxxxxxxxxxx> writes:
> What are the advantages or disadvantages of using arrays in this 
> situation?  The = ANY array method makes plpgsql development cleaner, 
> but seems to really lack performance in certain cases.

In existing releases, the form with IN (list-of-scalar-constants)
can be optimized into indexscan(s), but = ANY (array) isn't.

8.2 will treat them equivalently (in fact, it converts IN (...) to
= ANY (ARRAY[...]) !).  So depending on your time horizon, you might
wish to stick with whichever is cleaner for your calling code.

			regards, tom lane


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux