Re: index does not improve performance

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: Milos Prudek <milos(dot)prudek(at)tiscali(dot)cz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: index does not improve performance
Date: 2002-02-02 17:57:44
Message-ID: 3.0.6.32.20020202125744.007a2290@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-02-02 18:01:35 Re: Preformance
Previous Message Tom Lane 2002-02-02 17:49:22 Re: Distributing index's/tables/logs/etc.