Received: from mail.cii.sumy.ua (mail.cii.sumy.ua [212.1.122.61]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA10990 for ; Sun, 30 Jan 2000 16:25:13 -0500 (EST) (envelope-from vlad@infonet.com.ua) Received: from kuzja (ppp13.infonet.com.ua [212.1.122.45]) by mail.cii.sumy.ua (8.9.3/8.9.3) with SMTP id XAA85443 for ; Sun, 30 Jan 2000 23:26:28 GMT (envelope-from vlad@infonet.com.ua) Message-ID: <008801bf6b68$4b212f20$2d7a01d4@kuzja> From: "Vlad Marchenko" To: Subject: "Group by" and "index". Date: Sun, 30 Jan 2000 23:23:45 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1251" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Hi, PostgreSQL 6.5.3. I've created the following index: >create index test_index on test (filed1); >vacuum; And then: >explain select field1 from test group by field1; NOTICE: QUERY PLAN: Group (cost=2510.40 rows=58709 width=12) -> Sort (cost=2510.40 rows=58709 width=12) -> Seq Scan on test (cost=2510.40 rows=58709 width=12) It don't use this index :-(. I've tried to create two types of index: b-tree and hash - both doesn't work until "group" is present. If I type > explain select field1 from test where field1='tra-ta-ta'; NOTICE: QUERY PLAN: Index Scan using test_index on test (cost=2.05 rows=2 width=12) It work this way. Any ideas? _____________ Vlad Marchenko