From: | Korisk <Korisk(at)yandex(dot)ru> |
---|---|
To: | pgsql-performance(at)postgresql(dot)org |
Subject: | hash aggregation |
Date: | 2012-10-10 16:09:02 |
Message-ID: | 118871349885342@web16f.yandex.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Hello! Is it possible to speed up the plan?
hashes=# \d hashcheck
Table "public.hashcheck"
Column | Type | Modifiers
--------+-------------------+--------------------------------------------------------
id | integer | not null default nextval('hashcheck_id_seq'::regclass)
name | character varying |
value | character varying |
Indexes:
"btr" btree (name)
hashes=# select version();
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 9.2.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2), 64-bit
(1 row)
hashes=# explain analyse verbose select name, count(name) as cnt from hashcheck group by name order by name desc;
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------------
Sort (cost=573977.88..573978.38 rows=200 width=32) (actual time=10351.280..10351.551 rows=4000 loops=1)
Output: name, (count(name))
Sort Key: hashcheck.name
Sort Method: quicksort Memory: 315kB
-> HashAggregate (cost=573968.24..573970.24 rows=200 width=32) (actual time=10340.507..10341.288 rows=4000 loops=1)
Output: name, count(name)
-> Seq Scan on public.hashcheck (cost=0.00..447669.16 rows=25259816 width=32) (actual time=0.019..2798.058 rows=25259817 loops=1)
Output: id, name, value
Total runtime: 10351.989 ms
(9 rows)
hashes=#
Thank you.
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2012-10-10 16:10:12 | Re: shared_buffers/effective_cache_size on 96GB server |
Previous Message | Bruce Momjian | 2012-10-10 16:05:34 | Re: shared_buffers/effective_cache_size on 96GB server |