pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Brett <steve.brett@e-mis.com>
To: pgsql-sql@postgresql.org
Subject: Re: Index Management
Date: Fri, 1 Feb 2002 13:32:36 -0000
Message-ID: <a3e5n7$1mhr$1@news.tht.net> (raw)
References: <87d6zr1fdm.fsf@localhost.localdomain>

AFAIK the indeces are chosen by the query optimiser and used whenever they
are needed.

sometimes if the optimiser decides it may not use an index if there are a
small number of rows in the table and sequential scan would be as fast.

a general rule of thumb i use is that indexes are placed on tables if i have
a query that uses that attribute in the where clause.

Steve

"Paulo J. Matos" <pocm@rnl.ist.utl.pt> wrote in message
news:87d6zr1fdm.fsf@localhost.localdomain...
> Hi all,
>
> I've been creating indeces for my tables but I'm a bit lost
> now. I'd like to know how indeces are managed? Are them
> autommaticly chosen for a particular query? We choose the good
> ones (maybe through a sql command)?
> If I create 10 indeces and then I make some queries, how will
> postgres manage the indeces and how to work through the queries?
>
> Best regards,
>
> --
> Paulo J. Matos : pocm(_at_)rnl.ist.utl.pt
> Instituto Superior Tecnico - Lisbon
> Software & Computer Engineering - A.I.
>  - > http://www.rnl.ist.utl.pt/~pocm
>  ---
> Yes, God had a deadline...
> So, He wrote it all in Lisp!
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly





Message-ID: <a3e5n7$1mhr$1@news.tht.net>
Permalink:  ../a3e5n7$1mhr$1@news.tht.net/
Also on:    postgresql.org/message-id/a3e5n7$1mhr$1@news.tht.net

 · 

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: steve.brett@e-mis.com
  Subject: Re: Index Management
  In-Reply-To: <a3e5n7$1mhr$1@news.tht.net>

* 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