Re: accessing primary key slower than accessing non primary key???
В списке pgsql-novice по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: accessing primary key slower than accessing non primary key??? |
| Дата | |
| Msg-id | 13513.1045151137@sss.pgh.pa.us обсуждение |
| Ответ на | accessing primary key slower than accessing non primary key??? (HK <harikrishnan@midascomm.com>) |
| Список | pgsql-novice |
HK <harikrishnan@midascomm.com> writes:
> time in ms per query retrieval
> py key non py key
> ------ -----------
> 2000 15.8 15.7
> 10000 71.2 70.7
> 25000 174 173.5
> 100000 4319 3417
> As u see the non primary key retrieval is faster. AFAIK accessing primary
> key should be faster. Can anybody throw light on why is this anamoly.
There's nothing magic about primary keys in Postgres; I'd expect the
results to come out the same.
The first three of these look like they're indeed the same, to within
measurement error. Not sure about the last one; perhaps you had some
effect of physical order in the table agreeing with the ordering of the
non-primary key?
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера