Thread: Index Management

Index Management

From
pocm@rnl.ist.utl.pt (Paulo J. Matos)
Date:
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
wroteit all in Lisp!
 



Re: Index Management

From
"Steve Brett"
Date:
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