Re: INDEX suggestion needed
| От | Manfred Koizar |
|---|---|
| Тема | Re: INDEX suggestion needed |
| Дата | |
| Msg-id | r9bhvug5revknk0iidlrilk91igvkntmot@4ax.com обсуждение исходный текст |
| Ответ на | Re: INDEX suggestion needed (Thomas Beutin <tyrone@laokoon.IN-Berlin.DE>) |
| Ответы |
Re: INDEX suggestion needed
|
| Список | pgsql-general |
On Thu, 12 Dec 2002 15:33:11 +0100, Thomas Beutin
<tyrone@laokoon.IN-Berlin.DE> wrote:
> AND ( visit >= '2002-12-01' OR visit <= '2002-12-11');
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is logically equivalent to (visit IS NOT NULL), I guess you want
AND, not OR.
> -> Seq Scan on stat_pages (cost=0.00..13821.19 rows=343520 width=34)
>
>Is there any hope left? ;-)
Please show us the output of
VACUUM VERBOSE ANALYZE stat_pages;
EXPLAIN ANALYZE
SELECT COUNT(DISTINCT a_id)
FROM stat_pages
WHERE m_id = 35::smallint
AND (visit >= '2002-12-01' AND visit <= '2002-12-11');
SELECT attname, null_frac, avg_width, n_distinct,
most_common_vals, histogram_bounds, correlation
FROM pg_stats
WHERE tablename = 'stat_pages'
AND attname IN ('m_id', 'visit');
Servus
Manfred
В списке pgsql-general по дате отправления: