From: Sean Shanny <shannyconsulting@earthlink.net>
To: pgsql-performance@postgresql.org
Subject: Re: Question about difference in performance of 2 queries
Date: Mon, 29 Dec 2003 14:25:38 -0500
Message-ID: <3FF07FB2.5060608@earthlink.net> (raw)
In-Reply-To: <15476.1072716487@sss.pgh.pa.us>
References: <3FF057DF.7000605@earthlink.net>
<15476.1072716487@sss.pgh.pa.us>
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
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: shannyconsulting@earthlink.net
Subject: Re: Question about difference in performance of 2 queries
In-Reply-To: <3FF07FB2.5060608@earthlink.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox