Re: Advice for index design

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: Advice for index design
Дата
Msg-id kk9283$ctu$1@gonzo.reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на Advice for index design  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-sql
On 2013-04-10, JORGE MALDONADO <jorgemal1960@gmail.com> wrote:

> Our application offers a catalog of artists where a user can select a range
> of birthdays and/or sex. For example, a user can get an artists catalog for
> those  male artists who were born between May 1, 1970 and May 1, 1990
> ordered by birthday and, within each birthday date, ordered by name. I can
> think of defining one index for birthday, one index for name, and one index
> for sex.  Also, I can think of defining a compound index for birthday +
> name. Also there could be a compound index for sex + name. Another option
> could be a compound index for birthday + sex + name. There are many
> possible combinations. What is a good index design approach? 

the best approach depends on where you need the most improvement.

For your example query an undex on (sex,birthday,name) would be best.


-- 
⚂⚃ 100% natural




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

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: Advice for index design
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: Restrict FOREIGN KEY to a part of the referenced table