Re: Optimising "in" queries

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

 



[Please don't top post as it makes the discussion more difficult to follow.]

On Aug 22, 2007, at 18:30 , Stephen Davies wrote:

I have always thought of array processing as the thing that vector
processors such as Cray and ETA do/did.

(I've always heard that referred to as vector processing.)

While superficially equivalent, I have always believed that IN (a,b,c)
executed faster than =a or =b or =c. Am I wrong for PostgreSQL?

Depending on the numbers of the IN list and other statistcs, I believe PostgreSQL will rewrite z in IN (a, b, ...) into either (z = a) OR (z = b) OR ... or somehow add it to the join list, so performance will vary.

Michael Glaesemann
grzm seespotcode net



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

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

  Powered by Linux