Re: Can someone explain the problem with this select
| От | Richard Broersma Jr |
|---|---|
| Тема | Re: Can someone explain the problem with this select |
| Дата | |
| Msg-id | 159771.63914.qm@web31810.mail.mud.yahoo.com обсуждение исходный текст |
| Ответ на | Can someone explain the problem with this select (Richard Ray <rray@mstc.state.ms.us>) |
| Список | pgsql-sql |
> dcc=# EXPLAIN ANALYZE select * from documents left outer join comments on > (documents.doc_num = comments.doc_num) where documents.doc_num in (select > doc_num from documents limit 10); This query is preforming the join on all records of your two tables. After all of the that exhaustive work is done, it this filter out the records you want. you should preform a filtered select first and then use those results in you left join. I guess the lesson you can learn from this example is that you should try to filter your data set to get it as small as possible before you do anything else with it. select * from ( select doc_num from documents limit 10 ) as D1 left outer join comments on (D1.doc_num = comments.doc_num) ; Regards, Richard Broersma Jr.
В списке pgsql-sql по дате отправления: