Re: Problem with performance using query with unnest after migrating from V9.1 to V9.2 and higher

From: "Knels, Udo" <U(dot)Knels(at)treubuch-it(dot)de>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Problem with performance using query with unnest after migrating from V9.1 to V9.2 and higher
Date: 2016-09-26 15:59:58
Message-ID: d47753011ac64182aa3fada94c6a4710@EXCH-1.ddd-do.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

Thank you very much for your answers.

Yes, 50 rows aren't enough, but the original table has about 14 million rows and after analyzing the table I got the same result.

We changed our functions and used string_to_array instead of unnest and its ok.

It was not only a problem with one value to be selected. The problem exists with three or more too. Maybe the implementation of unnest has changed from V9.1 to V9.5. In V9.1 there was only one array as argument. Since V9.4 we can use more than one array as argument. And so the planner works different. So, if we change from one version to another in the future, we have to check the PostgreSQL-functions if the behaviour of the function or the planner has changed and then replace the function. It would be great if we could see this in the documentation.

Greetings

Udo Knels
treubuch IT GmbH

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2016-09-26 16:16:31 Re: [HACKERS] temporary table vs array performance
Previous Message David G. Johnston 2016-09-26 15:49:42 Re: [HACKERS] temporary table vs array performance