| От | Richard Huxton |
|---|---|
| Тема | Re: Improving a simple query? |
| Дата | |
| Msg-id | 49293.192.168.1.32.1058123357.squirrel@mainbox.archonet.com обсуждение исходный текст |
| Ответ на | Improving a simple query? (Steve Wampler <swampler@noao.edu>) |
| Ответы |
Re: Improving a simple query?
|
| Список | pgsql-performance |
> I'm not an SQL or PostgreSQL expert. > > I'm getting abysmal performance on a nested query and > need some help on finding ways to improve the performance: [snip] > select * from attributes_table where id in (select id from > attributes where (name='obsid') and (value='oid00066')); This is the classic IN problem (much improved in 7.4 dev I believe). The recommended approach is to rewrite the query as an EXISTS form if possible. See the mailing list archives for plenty of examples. Could you not rewrite this as a simple join though? - Richard
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера