| От | Greg Stark |
|---|---|
| Тема | Re: Diff between Primary key and non primary key select |
| Дата | |
| Msg-id | 87y94ij46y.fsf@stark.dyndns.tv обсуждение |
| Ответ на | Diff between Primary key and non primary key select (Deepa <kdeepa@midascomm.com>) |
| Список | pgsql-general |
Deepa <kdeepa@midascomm.com> writes: > In the above result, I cannot able to see much difference between > the time consumed using primary key and non-primary key value. Even in > some cases, I can able to see that using non primary key value retrieves record faster > than using primary key. Try running "analyze tablename". If you don't run analyze periodically postgres won't know about changes in the data such as a table growing large enough to warrant using an index. If that doesn't help, run your query in psql with the word "explain" before it and send the results. Also send the output of \d tablename. explain will say exactly what postgres is doing to run your query. It looks like the query with the primary key may not be using an index. -- greg
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера