Re: index does not improve performance - Mailing list pgsql-general

From Frank Bax
Subject Re: index does not improve performance
Date
Msg-id 3.0.6.32.20020202125744.007a2290@pop6.sympatico.ca
Whole thread Raw
In response to Re: index does not improve performance  (Milos Prudek <milos.prudek@tiscali.cz>)
List pgsql-general
The "VACUUM" part of "VACUUM ANALYZE" is like "PACK" from your FoxPro days.
 The extra speed came from making the physical files smaller.  A
significant difference from FoxPro is that with PG, an UPDATE actually does
a INSERT of a new row, and a DELETE of old row.  You will want to perform
VACUUM ANALYZE regularly.

The "Seq Scan" part of explain says that PG decided to do a sequential read
of your table, ignoring the index even when it did exist.  There must have
been other factors invloved to cause these queries to run in 4.5 and 5.0
seconds respectively.  They should have run in the same amount of time.

Frank

At 04:02 PM 2/2/02 +0100, Milos Prudek wrote:
>> BTW, have you VACUUM ANALYZE'd this table? What version of Pg are you
>
>On your advice I did VACUUM ANALYZE, and it did help! From 5.5 seconds
>I'm down to 3.4 seconds.
>
>I'm using PostgreSQL 7.1.3, RPM binary.
>
>
>> running? The output for 'explain' for these queries (with and without
>> index) would be helpful.
>
>With index:
>Aggregate  (cost=11292.20..11292.20 rows=1 width=0)
>  ->  Seq Scan on log  (cost=0.00..10679.25 rows=245182 width=0)
>
>Without index:
>Aggregate  (cost=11292.20..11292.20 rows=1 width=0)
>  ->  Seq Scan on log  (cost=0.00..10679.25 rows=245182 width=0)
>
>
>--
>Milos Prudek
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://archives.postgresql.org
>

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: index does not improve performance
Next
From: Tom Lane
Date:
Subject: Re: Preformance