Re: Indexes

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Indexes
Дата
Msg-id 43DDF582.2010308@magproductions.nl
обсуждение исходный текст
Ответ на Indexes  ("Silas Justiniano" <silasju@gmail.com>)
Список pgsql-general
Silas Justiniano wrote:
> enough for every query I want to perform? Or should I need
>
> CREATE UNIQUE INDEX foo ON Intermediate(book_id, author_id);
> CREATE UNIQUE INDEX bar ON Intermediate(book_id);
> CREATE UNIQUE INDEX baz ON Intermediate(author_id);

If you'd use plain indexes for the last two (without the UNIQUE part),
queries that would need to lookup only 1 of the columns in this table
could be faster (depending on which version of postgres you run - I
don't think it'll make any difference in 8 and up).
The same thing goes for all tables that have a foreign key to another
table; an index on those columns may help.

Mind you, this is more about optimization, not so much about database
design. It depends on your queries whether you're going to have any
benefit from this.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

//Showing your Vision to the World//

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Are rules transaction safe?
Следующее
От: "Leif B. Kristensen"
Дата:
Сообщение: Re: Indexes