| From: | Michael Glaesemann <grzm(at)seespotcode(dot)net> | 
|---|---|
| To: | Christo Du Preez <christo(at)mecola(dot)com> | 
| Cc: | pgsql-performance(at)postgresql(dot)org | 
| Subject: | Re: test / live environment, major performance difference | 
| Date: | 2007-06-12 13:47:05 | 
| Message-ID: | 6336D034-24D7-47B3-8690-9E7561E5432C@seespotcode.net | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-performance | 
On Jun 12, 2007, at 8:32 , Christo Du Preez wrote:
> 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;
The planner weighs the cost of the different access methods and  
choses the one that it believes is lowest in cost. An index scan is  
not always faster than a sequential scan. With so few rows, it's  
probably faster for the server to read the whole table rather than  
reading the index and looking up the corresponding row. If you want  
to test this, you can set enable_seqscan to false and try running  
your query again.
http://www.postgresql.org/docs/8.2/interactive/runtime-config- 
query.html#RUNTIME-CONFIG-QUERY-ENABLE
Michael Glaesemann
grzm seespotcode net
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Gregory Stark | 2007-06-12 13:53:26 | Re: test / live environment, major performance difference | 
| Previous Message | Reid Thompson | 2007-06-12 13:45:20 | Re: test / live environment, major performance difference |