query optimiser changes 6.5->7.0

From: "Simon Hardingham" <simon(at)netxtra(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: query optimiser changes 6.5->7.0
Date: 2000-06-01 17:32:47
Message-ID: 4DCB16536FCBD311897000A0C92A02ED19FA62@sauron.netxtra.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I apologise if I am being stupid or this is the wrong list, but here goes
anyway ;-)

I have a table of the following form:

Table "gazet"
Attribute | Type | Modifier
-----------+-------------+----------
country | integer |
name | varchar(30) |
lat | float4 |
long | float4 |
score | integer |
Index: gazet_index

gazet_index is an index defined as

create index gazet_index on gazet (country)

This table has a couple of million rows and I am executing the query:-

select * from gazet where country=1 and lower(name) = 'placename';

I have been running this with no problems on Postgres 6.5.1 and this query
takes about a second. I have now set-up a dedicated Postgres server using
version 7.0 and exported the entire database into it using a pg_dump. I
have then run vacuum to recreate indexes etc, but the query takes 7-8
seconds now. I have run explain on the query and it shows that it is just
performed a sequential scan on version 7.0

Seq Scan on gazet (cost.....)

On the old version (6.5.1) it reports

Index Scan using gazet_index on gazet (cost=....

Any suggestions as to how I can improve performance on this databases new
server?

Many thanks

Simon

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Simon Hardingham - netXtra Ltd - UK _/
_/ Tel: +44 (0) 1787 319393 Fax: +44 (0) 1787 319394 _/
_/ http://www.netxtra.co.uk simon(at)netxtra(dot)co(dot)uk _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Wampler 2000-06-01 18:00:09 Re: ALTERING A TABLE
Previous Message Tom Lane 2000-06-01 17:21:34 Re: Postmaster won't -HUP