| От | Josh Berkus |
|---|---|
| Тема | Re: Why the difference in plans ? |
| Дата | |
| Msg-id | 200803071723.25261.josh@agliodbs.com обсуждение исходный текст |
| Ответ на | Re: Why the difference in plans ? (Dave Cramer <pg@fastcrypt.com>) |
| Список | pgsql-performance |
Dave, > "user_profile_pkey" PRIMARY KEY, btree (uid) CLUSTER > "user_profile_name_idx" UNIQUE, btree (name varchar_pattern_ops) > "user_profile_name_key" UNIQUE, btree (name) > "user_profile_uploadcode_key" UNIQUE, btree (uploadcode) > "user_profile_active_idx" btree (isactive) > "user_profile_areacode_index" btree (areacode) > "user_profile_gender_idx" btree (gender) You need to change one of the name indexes to a functional index on lower(firstname). That'll speed the query up considerably. I'm still puzzled as to why the index is being used at all in the 2nd query, as it seems very unlikely to work out, but the above is the practical solution to your problem. -- --Josh Josh Berkus PostgreSQL @ Sun San Francisco
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера