Skip site navigation (1) Skip section navigation (2)

Re: Question about difference in performance of 2 queries

From: Sean Shanny <shannyconsulting(at)earthlink(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Question about difference in performance of 2 queries
Date: 2003-12-29 19:25:38
Message-ID: 3FF07FB2.5060608@earthlink.net (view raw or flat)
Thread:
Lists: pgsql-performance
Here is one of the explain analyzes.  This is the from the faster 
query.  Ignore the total runtime as we are currently doing other queries 
on this machine so it is slightly loaded.

Thanks.

--sean


explain analyze select count (distinct (persistent_cookie_key) ) from 
f_pageviews where date_key between 305 and 334 and content_key <> -1;
                                                                                
QUERY PLAN
    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Aggregate  (cost=1384925.95..1384925.95 rows=1 width=4) (actual 
time=4541462.030..4541462.034 rows=1 loops=1)
   ->  Index Scan using idx_pageviews_date_nov_2003 on f_pageviews  
(cost=0.00..1343566.52 rows=16543772 width=4) (actual 
time=83.267..4286664.678 rows=15710722 loops=1)
         Index Cond: ((date_key >= 305) AND (date_key <= 334))
         Filter: (content_key <> -1)
 Total runtime: 4541550.832 ms
(5 rows)

Tom Lane wrote:

>Please show EXPLAIN ANALYZE output for your queries, not just EXPLAIN.
>Also it would be useful to see the pg_stats rows for the date_key and
>content_key columns.
>
>			regards, tom lane
>
>  
>


In response to

pgsql-performance by date

Next:From: Tom LaneDate: 2003-12-29 19:39:11
Subject: Re: Question about difference in performance of 2 queries
Previous:From: Sean ShannyDate: 2003-12-29 18:46:09
Subject: Re: Question about difference in performance of 2 queries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group