Re: indexes

Поиск
Список
Период
Сортировка
От Seb
Тема Re: indexes
Дата
Msg-id 87fx64jk0f.fsf@kolob.sebmags.homelinux.org
обсуждение исходный текст
Ответ на indexes  (Seb <spluque@gmail.com>)
Ответы Re: indexes
Список pgsql-sql
On Mon, 18 Jan 2010 08:59:56 +1100,
Chris <dmagick@gmail.com> wrote:

>> o Should all foreign keys have an index?

> Not necessarily, you might just want the db to enforce the restriction
> but not actually use the data in it. For example, keep a userid (and
> timestamp) column of the last person to update a row. You may need it
> to say "aha - this was last changed on this date and by person X", but
> you'll never generally use it.

> If you never have a where clause with that column, no need to index
> it. If you're using it in a join all the time, then yes it would be
> better to index it.

Thanks for all your pointers!

Do views use the indexes in the underlying tables, whenever say a SELECT
operation is called on the view?  If so, indexes on views don't make any
sense right?


-- 
Seb



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

Предыдущее
От: Chris
Дата:
Сообщение: Re: indexes
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: indexes