Re: index scan - Mailing list pgsql-sql

From Richard Huxton
Subject Re: index scan
Date
Msg-id 423EB18D.50403@archonet.com
Whole thread Raw
In response to index scan  (Mihail Nasedkin <m.nasedkin.perm@mail.ru>)
List pgsql-sql
Please CC the list as well as replying directly to me. I don't read this 
email address often.

Mihail Nasedkin wrote:
> 
> RH> Why do you want an index scan? Do you have any evidence it will be
> RH> faster than a sequential scan?
> 
> No, but I want to be ready for make Index scan queries in future. I
> make first steps on the customize SQL.

PostgreSQL uses statistics on what values are in what columns to decide 
how to plan a query. So - if you are asking for all rows from a table it  probably won't use an index because it knows
youwill have to read the 
 
whole table anyway.

> Where I can read more about optimize the SQL-queries and about
> differences between types of scan?

Well, perhaps the best place to learn more is the performance mailing 
list. You can see plenty of real-world problems being discussed there.

Two sections of the manual you should read are  Chapter 13. Performance Tips  Chapter 23. Monitoring Database Activity
Understanding how to read EXPLAIN ANALYSE output and manage statistics 
are vital.

Finally, details on configuration settings can be found at:  http://www.powerpostgresql.com/PerfList
http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php

--  Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Béatrice Yueksel
Date:
Subject: Re: Your question about date
Next
From: Martín Marqués
Date:
Subject: CASE not working