pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Mihail Nasedkin <m.nasedkin.perm@mail.ru>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: index scan
Date: Mon, 21 Mar 2005 11:35:41 +0000
Message-ID: <423EB18D.50403@archonet.com> (raw)
In-Reply-To: <12025880984.20050321150346@mail.ru>
References: <10520036015.20050321132621@mail.ru>
	<423E90BC.80501@archonet.com>
	<12025880984.20050321150346@mail.ru>

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



view thread (6+ messages)

Message-ID: <423EB18D.50403@archonet.com>
Permalink:  ../423EB18D.50403@archonet.com/
Also on:    postgresql.org/message-id/423EB18D.50403@archonet.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-sql@postgresql.org
  Cc: dev@archonet.com, m.nasedkin.perm@mail.ru
  Subject: Re: index scan
  In-Reply-To: <423EB18D.50403@archonet.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