Re: INDEX suggestion needed - Mailing list pgsql-general

From Tom Lane
Subject Re: INDEX suggestion needed
Date
Msg-id 10421.1039706750@sss.pgh.pa.us
Whole thread Raw
In response to Re: INDEX suggestion needed  (Thomas Beutin <tyrone@laokoon.IN-Berlin.DE>)
List pgsql-general
Thomas Beutin <tyrone@laokoon.IN-Berlin.DE> writes:
> tb=# EXPLAIN select count(distinct a_id) from stat_pages WHERE m_id = 35 AND ( visit >= '2002-12-01' OR visit <=
'2002-12-11');

Do you really mean OR there, and not AND?  As given, the query looks
mighty unselective to me --- I'd think it should *not* use an index.
The planner evidently thinks so too.  (How accurate is the rowcount
estimate, anyway?)

            regards, tom lane

pgsql-general by date:

Previous
From: "SZŰCS Gábor"
Date:
Subject: Re: Planner weakness (was: Re: ExecEvalExpr: unknown expression type 108)
Next
From: Jeff Eckermann
Date:
Subject: Re: Is it possible to Import tables and its data from Ms Access