Re: Tuning to speed select

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
Cc: Harald Armin Massa <haraldarminmassa(at)gmail(dot)com>, louis gonzales <gonzales(at)linuxlouis(dot)net>, Tom Laudeman <twl8n(at)virginia(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Tuning to speed select
Date: 2006-08-10 09:46:43
Message-ID: 44DB0083.6060608@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Broersma Jr wrote:
>> Views certainly help in managing complexity. They do nothing to improve
>> query-speed.
>>
>> Querying a view gets rewritten to queries to the underlying tables on the
>> fly.
>> (as long as there are no materialized views, which are still on a the TODO
>> list)
>
> Would partial indexs on the most queried regions of the table help in query speed?

They would, as long as they can be used in the client application
queries. If all the data is often used (partially or not), then there's
little point to partial indices. But that's a border-case. In common,
they can make major differences.

Also, make sure you add enough constraints to your query so that the
partial index constraints match your query constraints, otherwise the
index will not be used.

Another point to check; make sure you don't cause type casts over
indexed columns. That might (under certain conditions) cause a type cast
on the column value of every indexed row, which does slow down things
significantly. I believe this was solved in PostgreSQL 8.something.

--
Alban Hertroys
alban(at)magproductions(dot)nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
7500 AK Enschede

// Integrate Your World //

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roger Mason 2006-08-10 10:27:20 psycopg problem
Previous Message John Sidney-Woollett 2006-08-10 06:57:44 Re: Importance of re-index