X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F095C5E46C4 for ; Wed, 18 Aug 2004 14:12:18 -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 66809-04 for ; Wed, 18 Aug 2004 17:12:22 +0000 (GMT) Received: from stubee.d2hosting.net (d2hosting.net [66.70.41.160]) by svr1.postgresql.org (Postfix) with ESMTP id DE41B5E37CB for ; Wed, 18 Aug 2004 14:12:12 -0300 (ADT) Received: from [127.0.0.1] (stubee.d2hosting.net [66.70.41.160]) by stubee.d2hosting.net (8.11.6/linuxconf) with ESMTP id i7IHCGA27374; Wed, 18 Aug 2004 12:12:16 -0500 Message-ID: <41238DFA.1030207@idigx.com> Date: Wed, 18 Aug 2004 12:12:26 -0500 From: Thomas Swan User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Igor Artimenko Cc: pgsql-performance@postgresql.org Subject: Re: I could not get postgres to utilizy indexes References: <5DEC3FFCDE2F7C4DA45433EE09A4F22C01A3FFCA@colossus.dyadem.corp> In-Reply-To: <5DEC3FFCDE2F7C4DA45433EE09A4F22C01A3FFCA@colossus.dyadem.corp> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/276 X-Sequence-Number: 7912 Igor Artimenko wrote: >Hi verybody! > >I can't make use of indexes even I tried the same test by changing different settings in postgres.conf like geqo to off/on & geqo related parameters, enable_seqscan off/on & so on. Result is the same. > >Here is test itself: > >I've created simplest table test and executed the same statement "explain analyze select id from test where id = 50000;" Few times I added 100,000 records, applied vacuum full; and issued above explain command. >Postgres uses sequential scan instead of index one. >Of cause Time to execute the same statement constantly grows. In my mind index should not allow time to grow so much. > >Why Postgres does not utilizes primary unique index? >What I'm missing? It continue growing even there are 1,200,000 records. It should at least start using index at some point. > > > Igor, you may want to run "vacuum analyze" and see if your results change. Thomas