Re: INDEX suggestion needed - Mailing list pgsql-general

From Manfred Koizar
Subject Re: INDEX suggestion needed
Date
Msg-id r9bhvug5revknk0iidlrilk91igvkntmot@4ax.com
Whole thread Raw
In response to Re: INDEX suggestion needed  (Thomas Beutin <tyrone@laokoon.IN-Berlin.DE>)
Responses Re: INDEX suggestion needed  (Thomas Beutin <tyrone@laokoon.IN-Berlin.DE>)
List 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 by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: Re: INDEX suggestion needed
Next
From: "Johnson, Shaunn"
Date:
Subject: installing with readline