Re: [PERFORM] Question about query planner

2006-02-19 Thread Tom Lane
Emil Briggs <[EMAIL PROTECTED]> writes: > Does any know why the query behaves like this? Does it have anything to > do with the OR statements in the where clause spanning two different tables? Exactly. > SELECT DISTINCT a.account_id, l.username, a.status, a.company, a.fax_num, > a.primary_phone

[PERFORM] Question about query planner

2006-02-19 Thread Emil Briggs
The following query runs much slower than I would have expected. I ran it through EXPLAIN ANALYZE (results included after) and I don't understand why the planner is doing what it is. All of the columns from the WHERE part of the query are indexed and the indexes are being used. The number of r