Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5BClUE56446 for ; Mon, 11 Jun 2001 08:47:30 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f54LwVE44752 for ; Mon, 4 Jun 2001 17:58:31 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f54LkuI73995 for pgsql-sql@postgresql.org; Mon, 4 Jun 2001 17:46:56 -0400 (EDT) (envelope-from news) From: =?iso-8859-1?Q?Hans=2DJ=FCrgen=20Sch=F6nig?= X-Newsgroups: comp.databases.postgresql.sql Subject: Re: select distinct too slow Date: Mon, 04 Jun 2001 23:45:10 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 16 Message-ID: <3B1C0166.FC3E4CF5@cybertec.at> References: <20010601123641.4c0d96c0.gry@ll.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [de] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200106/152 X-Sequence-Number: 3373 Did you vacuum analyse your table after creating the index? A solution for your problem would be to turn sequential scans ofd before querying the table. This should work somehow like that: myjava=# SET enable_seqscan TO 'off'; SET VARIABLE myjava=# show enable_seqscan; NOTICE: enable_seqscan is off SHOW VARIABLE check out the docs for further information. Hans