| От | Richard Huxton |
|---|---|
| Тема | Re: Join Table |
| Дата | |
| Msg-id | 41866DA3.3020704@archonet.com обсуждение |
| Ответ на | Join Table (T E Schmitz <mailreg@numerixtechnology.de>) |
| Список | pgsql-sql |
T E Schmitz wrote: > Hello, > > I have created the following join table: the two FKs are the PK of the > table. Typically, I will need to select rows for a given ITEM_FK. > > Question: is it necessary/advisable to create an index for the ITEM_FK > column? Or is this redundantbecause this column is already one of the PK > columns? > > CREATE TABLE SUPPLY > ( > ITEM_FK integer NOT NULL, > CONTACT_FK integer NOT NULL, > COST numeric (7,2), > PRIMARY KEY (ITEM_FK,CONTACT_FK) > ); The primary-key index can be used for ITEM_FK but not CONTACT_FK, so you might want an index on that column. -- Richard Huxton Archonet Ltd
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера