Re: Subqueries or Joins? Problems with multiple table query
| От | A. Kretschmer |
|---|---|
| Тема | Re: Subqueries or Joins? Problems with multiple table query |
| Дата | |
| Msg-id | 20100223143841.GE20866@a-kretschmer.de обсуждение |
| Ответ на | Re: Subqueries or Joins? Problems with multiple table query ("A. Kretschmer" <andreas.kretschmer@schollglas.com>) |
| Список | pgsql-general |
In response to A. Kretschmer : > In response to Thom Brown : > > On 23 February 2010 13:43, Stefan Schwarzer > > <stefan.schwarzer@grid.unep.ch> wrote: > > >>>> Select countries.name, basel.year, basel.value, cites.year, cites.value > > >>>> From countries > > >>>> Left Join basel on basel.id_country = countries.id_country and > > >>>> basel.value=1 > > >>>> Left Join cites on cites.id_country = countries.id_country and > > >>>> cites.value=1 > > >>> > > >>> I would have thought so, but the query turns forever. > > >> > > >> How many rows in each of your tables, and what indexes do you have? > > > > > > around 5000 rows > > > > > > > It takes a long time for just 5000 rows? Could you provide the > > execution plan for it by putting EXPLAIN ANALYZE at the front of your > > query and post the result here? > > I think, this query: Ouch, i'm wrong, sorry. Regards, Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99
В списке pgsql-general по дате отправления: