Re: Should I add a Index Key in this case ?

Поиск
Список
Период
Сортировка
От Rob Sargent
Тема Re: Should I add a Index Key in this case ?
Дата
Msg-id 11B38F25-EED7-478D-9B02-7D1DF67A5862@gmail.com
обсуждение исходный текст
Ответ на Re: Should I add a Index Key in this case ?  (Karen Goh <karenworld@yahoo.com>)
Список pgsql-sql


On Oct 16, 2019, at 9:47 AM, Karen Goh <karenworld@yahoo.com> wrote:

Hi Steve,

My question is should I use index on the Seat_Viewing_id ?

I have no experience in using Index hence I asked if it should be made auto-incremental?

Kindly advise how should I alter my existing table to have index. 

Tks!

alter table doc here: https://www.postgresql.org/docs/10/sql-altertable.html
you will likely need an index on that new column, though it’s not clear to how you wish to fill in the value for existing rows.  Perhaps you should share your current table definition?
I think you may need a seat_viewing table, in which you place the id of the viewed seats.  You would want a unique index on the new table using the existing seat id but you do NOT want the column to be of type serial, just (big?) integer.

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

Предыдущее
От: Karen Goh
Дата:
Сообщение: Re: Should I add a Index Key in this case ?
Следующее
От: Arni Kromić
Дата:
Сообщение: Re: Save Session?