From: Andrey Repko <repko@sart.must-ipra.com>
To: pgsql-performance@postgresql.org
Subject: Index not used on group by
Date: Tue, 27 Sep 2005 12:14:31 +0300
Message-ID: <144520928.20050927121431@sart.must-ipra.com> (raw)
Hello all,
I have table ma_data, that contain above 300000 rows.
This table has primary key id, and field alias_id.
I create index (btree)on this field.
Set statistic:
ALTER TABLE "public"."ma_data"
ALTER COLUMN "alias_id" SET STATISTICS 998;
So, when I do something like
SELECT alias_id FROM ma_data GROUP BY alias_id
and have (with seq_scan off):
Group (cost=0.00..1140280.63 rows=32 width=4) (actual time=0.159..2640.090 rows=32 loops=1)
-> Index Scan using reference_9_fk on ma_data (cost=0.00..1139526.57 rows=301624 width=4) (actual time=0.120..1471.128 rows=301624 loops=1)
Total runtime: 2640.407 ms
(3 rows)
As I understand there are some problems with visibility of records,
but some others DBMS used indexes without problems(for example
FireBird)? Or maybe some another information be helpful for me and
community.
--
С наилучшими пожеланиями,
Репко Андрей Владимирович mailto:repko@sart.must-ipra.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: repko@sart.must-ipra.com
Subject: Re: Index not used on group by
In-Reply-To: <144520928.20050927121431@sart.must-ipra.com>
References: <144520928.20050927121431@sart.must-ipra.com>
* 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