X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2E8E1D98CA for ; Tue, 27 Sep 2005 06:15:14 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81076-02 for ; Tue, 27 Sep 2005 09:15:05 +0000 (GMT) Received: from sart.must-ipra.com (unknown [80.91.172.78]) by svr1.postgresql.org (Postfix) with ESMTP id 83371D98C1 for ; Tue, 27 Sep 2005 06:15:06 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by sart.must-ipra.com (Postfix) with ESMTP id 37F8A3C162 for ; Tue, 27 Sep 2005 12:12:27 +0300 (EEST) Received: from sart.must-ipra.com ([127.0.0.1]) by localhost (sart.must-ipra.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23397-05 for ; Tue, 27 Sep 2005 12:12:23 +0300 (EEST) Received: from PRG-45 (unknown [10.0.0.45]) by sart.must-ipra.com (Postfix) with ESMTP id D5E963C15F for ; Tue, 27 Sep 2005 12:12:23 +0300 (EEST) Date: Tue, 27 Sep 2005 12:14:31 +0300 From: Andrey Repko X-Mailer: The Bat! (v3.5.25) Professional Reply-To: =?Windows-1251?Q?=C0=ED=E4=F0=E5=E9_=D0=E5=EF=EA=EE?= Organization: =?Windows-1251?Q?=CE=CE=CE_=22=D1=C0=D0=D2=22?= X-Priority: 3 (Normal) Message-ID: <144520928.20050927121431@sart.must-ipra.com> To: pgsql-performance@postgresql.org Subject: Index not used on group by MIME-Version: 1.0 Content-Type: text/plain; charset=Windows-1251 Content-Transfer-Encoding: 8bit X-Virus-Scanned: amavisd-new at sart.must-ipra.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 required=5 tests=[AWL=0.007] X-Spam-Level: X-Archive-Number: 200509/367 X-Sequence-Number: 14675 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