Re: INDEX suggestion needed

Поиск
Список
Период
Сортировка
От Thomas Beutin
Тема Re: INDEX suggestion needed
Дата
Msg-id 20021212153311.A18238@laokoon.bug.net
обсуждение исходный текст
Ответ на Re: INDEX suggestion needed  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: INDEX suggestion needed  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: INDEX suggestion needed  (Manfred Koizar <mkoi-pg@aon.at>)
Список pgsql-general
On Thu, Dec 12, 2002 at 12:56:38AM -0500, Tom Lane wrote:
> Thomas Beutin <tyrone@laokoon.IN-Berlin.DE> writes:
> > i cannot create an index like this:
> > CREATE INDEX "stat_pages_datum_idx" on "stat_pages" ( date ("visit") );
>
> You are overthinking the problem.  A plain index on "visit" would work
> fine for the example query you gave.
Unfortunally it doesn't work, i'm still running in sequence
scans all the time:
tb=# CREATE INDEX tb5 ON stat_pages (visit);
CREATE
tb=# VACUUM FULL ANALYZE stat_pages;
VACUUM
tb=# EXPLAIN select count(distinct a_id) from stat_pages WHERE m_id = 35 AND ( visit >= '2002-12-01' OR visit <=
'2002-12-11');
NOTICE:  QUERY PLAN:

Aggregate  (cost=14679.99..14679.99 rows=1 width=34)
  ->  Seq Scan on stat_pages  (cost=0.00..13821.19 rows=343520 width=34)

Is there any hope left? ;-)

-tb
--
Thomas Beutin                             tb@laokoon.IN-Berlin.DE
Beam me up, Scotty. There is no intelligent live down in Redmond.

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Planner weakness (was: Re: ExecEvalExpr: unknown expression type 108)
Следующее
От: "SZŰCS Gábor"
Дата:
Сообщение: Re: Planner weakness (was: Re: ExecEvalExpr: unknown expression type 108)