pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christo Du Preez <christo@mecola.com>
To: Reid.Thompson@ateb.com
Cc: pgsql-performance@postgresql.org
Subject: Re: test / live environment, major performance difference
Date: Tue, 12 Jun 2007 16:11:33 +0200
Message-ID: <466EA995.7020106@mecola.com> (raw)
In-Reply-To: <1181655920.19256.3.camel@jhereg>
References: <466EA078.20601@mecola.com>
	<1181655920.19256.3.camel@jhereg>

The actual table I noticed the problem has a million rows and it still
doesn't use indexing

Reid Thompson wrote:
> try it with a table with 650K rows...
>
> On Tue, 2007-06-12 at 15:32 +0200, Christo Du Preez wrote:
>   
>> Good day,
>>
>> I have noticed that my server never uses indexing. No matter what I do.
>>
>> As an example I took a table with about 650 rows, having a parentid
>> field with an index on parentid.
>>
>> EXPLAIN ANALYZE
>> SELECT *
>>   FROM layertype
>> where parentid = 300;
>>
>> On my laptop the explain analyze looks like this:
>>
>> "Index Scan using fki_layertype_parentid on layertype  (cost=0.00..8.27
>> rows=1 width=109)"
>> "  Index Cond: (parentid = 300)"
>>
>> and on the problem server:
>>
>> "Seq Scan on layertype  (cost=0.00..20.39 rows=655 width=110)"
>> "  Filter: (parentid = 300)"
>>
>> .........
>>
>> I have dropped the index, recreated it, vacuumed the table, just about
>> everything I could think of, And there is just no way I can get the
>> query planner to use the index.
>>
>> PostgreSQL 8.2.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.2
>> 20061115 (prerelease) (SUSE Linux)
>> POSTGIS="1.2.1" GEOS="3.0.0rc4-CAPI-1.3.3" PROJ="Rel. 4.5.0, 22 Oct
>> 2006" USE_STATS
>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 3: Have you checked our extensive FAQ?
>>
>>                http://www.postgresql.org/docs/faq
>>     
>
>
>   

-- 
Christo Du Preez

Senior Software Engineer
Mecola IT
Mobile:	 +27 [0]83 326 8087
Skype:	 christodupreez
Website: http://www.locateandtrade.co.za




view thread (20+ messages)  latest in thread

Message-ID: <466EA995.7020106@mecola.com>
Permalink:  ../466EA995.7020106@mecola.com/
Also on:    postgresql.org/message-id/466EA995.7020106@mecola.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: christo@mecola.com, Reid.Thompson@ateb.com
  Subject: Re: test / live environment, major performance difference
  In-Reply-To: <466EA995.7020106@mecola.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox