Re: INDEX suggestion needed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Beutin <tyrone(at)laokoon(dot)IN-Berlin(dot)DE>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: INDEX suggestion needed
Date: 2002-12-12 15:25:50
Message-ID: 10421.1039706750@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Beutin <tyrone(at)laokoon(dot)IN-Berlin(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Eckermann 2002-12-12 15:26:34 Re: Is it possible to Import tables and its data from Ms Access
Previous Message SZŰCS Gábor 2002-12-12 14:46:53 Re: Planner weakness (was: Re: ExecEvalExpr: unknown expression type 108)