On Mon, 2006-10-23 at 12:30 -0500, Jim C. Nasby wrote: > No, I don't actually use dbmail... I'm here because I'm a bit of a > PostgreSQL zealot and want to offer support to projects that are using
Ok, thanks. > it. The OP or someone else will need to post the output of EXPLAIN > ANALYZE from the different versions of that query. I suspect that it > will still show that either BETWEEN or > 2 are the best bet, but if > you're going to change code you should have actual data to back that > change up, not just what the planner is guessing (which is all that a > plain EXPLAIN shows). Also, this will depend on how large the indexes > are, so it would be good if people with different size databases can run > the test (I believe that the larger the database, the less it will > matter which version is used). Right, we've seen the plans change before. > BTW, I also noticed one email showed "IN ('1', '2')" - there's no reason > to quote parameters because that makes the planner treat them as text. > On some versions, that means it won't use the index at all, on some > others it means it has to re-cast the text, which is just wasted cycles. Fixed last week. Aaron