| От | Linh Luong |
|---|---|
| Тема | Using indexes |
| Дата | |
| Msg-id | 3B157646.EABF2998@computalog.com обсуждение исходный текст |
| Ответы |
Re: Using indexes
|
| Список | pgsql-sql |
Hi, Indexes are used to find a record faster in a table. It only seems to work if I am working with one table. eg) > create index customer_id_idx on customer(id); > select * from customer where id=1; -- This uses the index I create However, when I start to join 2 or more tables together it doesn't seem to use it.. WHY??? eg) > create index customer_id_idx on customer(id); > select * from customer, purchaseorder where customer.id=purchaseorder.id; -- This results in a seq scan .. WHY?? Is there a way to make it so that it uses my index Thanks again.
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера