| От | WireSpot |
|---|---|
| Тема | query time |
| Дата | |
| Msg-id | b2d4b03805020202336f0ceccb@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: query time
|
| Список | pgsql-general |
I have a table with about 200.000 entries. Among other things, it contains an integer field I use as a timestamp, and a variable character field I use for user names. Certain queries are taking too long IMO. I'm trying this on both 7.4 and 8.0. If I do a direct comparison (using =) on the user name field and I sort by the numeric field, I get about 5 ms. If I do a LIKE on the user name and I don't sort at all, I get about 5 ms too. But if I use both LIKE on the user name and sorting on the timestamp, the time jumps to 2000 ms. I have indexes on both fields, but I remember reading only one of them will be used when doing a query. Is such a serious jump in query times normal or am I doing something wrong? I'm attaching the explain output for all 3 cases.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера