From: | Richard Huxton <dev(at)archonet(dot)com> |
---|---|
To: | Mihail Nasedkin <m(dot)nasedkin(dot)perm(at)mail(dot)ru>, pgsql-sql <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: index scan |
Date: | 2005-03-21 11:35:41 |
Message-ID: | 423EB18D.50403@archonet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 you will 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
From | Date | Subject | |
---|---|---|---|
Next Message | osmar | 2005-03-21 14:11:26 | Accessing other Databases |
Previous Message | Béatrice Yueksel | 2005-03-21 10:59:18 | Re: Your question about date |