Re: Question about difference in performance of 2 queries

From: Sean Shanny <shannyconsulting(at)earthlink(dot)net>
To: pgsql-performance(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Question about difference in performance of 2 queries
Date: 2003-12-29 18:46:09
Message-ID: 3FF07671.7050706@earthlink.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Here is the pg_stats data. The explain analyze queries are still running.

select * from pg_stats where tablename = 'f_pageviews' and attname =
'date_key';
schemaname | tablename | attname | null_frac | avg_width |
n_distinct | most_common_vals
|
most_common_freqs
| histogram_bounds | correlation
------------+-------------+----------+-----------+-----------+------------+-------------------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------+-------------
public | f_pageviews | date_key | 0 | 4 |
60 | {335,307,309,336,308,321,314,342,322,316} |
{0.0283333,0.0243333,0.0243333,0.0243333,0.024,0.0233333,0.0226667,0.0226667,0.0223333,0.0216667}
| {304,311,318,325,329,334,341,346,351,356,363} | 0.345026
(1 row)

select * from pg_stats where tablename = 'f_pageviews' and attname =
'content_key';
schemaname | tablename | attname | null_frac | avg_width |
n_distinct | most_common_vals | most_common_freqs
|
histogram_bounds | correlation
------------+-------------+-------------+-----------+-----------+------------+------------------+-----------------------+-------------------------------------------------------------------------------------+-------------
public | f_pageviews | content_key | 0 | 4 |
983 | {-1,1528483} | {0.749333,0.00166667} |
{38966,323835,590676,717061,919148,1091875,1208244,1299702,1375366,1434079,1528910}
| 0.103399
(1 row)

Thanks.

--sean

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

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Sean Shanny 2003-12-29 19:25:38 Re: Question about difference in performance of 2 queries
Previous Message Sean Shanny 2003-12-29 17:44:11 Re: Question about difference in performance of 2 queries