> There's 6 cases here, in a 2x3 array. In one dimension, the LHS can be > either a Var or a fixed value. In the other dimension, the three > possibilities are 1: everything on the RHS is a fixed value, 2: some fixed, > some not, 3: everything on the RHS is a variable: [...lengthy discussion of cases...]
It seems like you're saying that the only time the array wins here is when you're comparing an expression against a whole bunch of constants. Given that, would it make any sense to put all the constants in an ARRAY and use OR for any variables? i.e. given Whatever IN (Const1, Var1, Const2, Var2, Const3, Var3) Generate: Whatever = ANY (ARRAY[Const1, Const2, Const3]) OR Whatever = Var1 OR Whatever = Var2 OR Whatever = Var3 ...Robert -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers