Re: UNION and bad performance

От: Marc Mamin
Тема: Re: UNION and bad performance
Дата: ,
Msg-id: C4DAC901169B624F933534A26ED7DF31034BB99A@JENMAIL01.ad.intershop.net
(см: обсуждение, исходный текст)
Ответ на: UNION and bad performance  (Olivier Pala)
Ответы: Re: UNION and bad performance  (Andreas Kretschmer)
Список: pgsql-performance

Скрыть дерево обсуждения

UNION and bad performance  (Olivier Pala, )
 Re: UNION and bad performance  ("Marc Mamin", )
  Re: UNION and bad performance  (Andreas Kretschmer, )
 Re: UNION and bad performance  (pasman pasmański, )
  Re: UNION and bad performance  (Robert Haas, )
   Re: UNION and bad performance  (pinker, )
 Re: UNION and bad performance  (David G Johnston, )

Hello,

 

UNION will remove all duplicates, so that the result additionally requires to be sorted.

Anyway,  for performance issues, you should always start investigation with explain analyze .

regards,

 

Marc Mamin

 

From: [mailto:] On Behalf Of Olivier Pala
Sent: Donnerstag, 9. Dezember 2010 11:52
To:
Cc: Olivier Pala
Subject: [PERFORM] UNION and bad performance

 

Hi,

I have a performance trouble with UNION query


First I have this view :

    SELECT a,b,c FROM table1, table2 WHERE jointure AND condition

    Result : 150 000 records in 1~2 s



Then, I adding an UNION into the same view :

    SELECT a,b,c FROM table1, table2 WHERE jointure AND condition
    UNION
    SELECT a,b,c FROM table3

    Result : 150 200 records in 6~7 s



Why, do I have bad performance only for 200 adding records ?

Thanks

SGBD : Postgres 8.3 et 8.4


В списке pgsql-performance по дате сообщения:

От: Andreas Kretschmer
Дата:
Сообщение: Re: UNION and bad performance
От: pasman pasmański
Дата:
Сообщение: Re: UNION and bad performance