[GENERAL] Performance difference between ANY and IN, also array syntax

2005-04-26 Thread Bart Grantham
Hello, all. I work for a Manhattan ISP and have developed an internal systems management/housekeeping app on php/postgres 7.4. I am trying to speed up some bits with stored procedures and have had great success, except I've now run into a bit of trouble. It comes down to this: # SELECT * FRO

Re: [GENERAL] Performance difference between ANY and IN, also array syntax

2005-04-26 Thread James Robinson
Without anything truly fancy, you could write a proc which dynamically builds a query string using the IN form out of a array parameter: You get to do a bunch of string contatenation and you don't get the luxury of pre-planning, but this technique might work for you. If your arrays aren't too b

Re: [GENERAL] Performance difference between ANY and IN, also array syntax

2005-04-26 Thread Tom Lane
Bart Grantham <[EMAIL PROTECTED]> writes: > It comes down to this: > # SELECT * FROM connections WHERE connectee_node_id = ANY ( > ARRAY[28543,28542] ); > [ performance sucks ] Yeah :-(. The = ANY (array) notation is new in the last release or so, and is completely without optimization of any

Re: [GENERAL] Performance difference between ANY and IN, also array syntax

2005-04-26 Thread Ron Mayer
Tom Lane wrote: Bart Grantham <[EMAIL PROTECTED]> writes: # SELECT * FROM connections WHERE connectee_node_id = ANY (ARRAY[28543,28542] ); [ performance sucks ] Yeah :-(. The = ANY (array) notation is new in the last release or so, and is completely without optimization of any kind. Turn it int