| От | Tomasz Myrta |
|---|---|
| Тема | Re: Is a better way to have the same result of this |
| Дата | |
| Msg-id | 3DEFAAF7.6040000@klaster.net обсуждение исходный текст |
| Ответ на | Re: Is a better way to have the same result of this (Vernon Wu <vernonw@gatewaytech.com>) |
| Список | pgsql-performance |
Vernon Wu wrote: > Ron, > > The gender is indexed. Each user has account and preference, but not necessary block. Indexing on gender won't speed up your query - it can even slow it down. You have probably 50% of "f" and 50% of "m". Using index on gender will divide your potential answers by 2. Make index on columns, which excludes much more useless rows. I think you can create index on: - block/personid - profile/userid I read in Postgres documentation(but didn't try) that you can also change "id NOT IN (select id" to "not exists select * where id=". It may help also. Do user have more than one account or preference? If no, you can change "not in" into "inner/outer join" which are the best ones. Regards, Tomasz Myrta
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера