Re: Index Management

From: "Steve Brett" <steve(dot)brett(at)e-mis(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Index Management
Date: 2002-02-01 13:32:36
Message-ID: a3e5n7$1mhr$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)rnl(dot)ist(dot)utl(dot)pt> wrote in message
news:87d6zr1fdm(dot)fsf(at)localhost(dot)localdomain(dot)(dot)(dot)
> 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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message David M. Richter 2002-02-01 14:36:04 pg_vlock / vacuum
Previous Message Steve Brett 2002-02-01 13:29:36 Re: test the existence of a database