Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boYLr-0005vU-UP for pgsql-performance@arkaria.postgresql.org; Mon, 26 Sep 2016 16:01:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1boYLr-0005np-5t for pgsql-performance@arkaria.postgresql.org; Mon, 26 Sep 2016 16:01:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1boYKC-0003tH-GQ for pgsql-performance@postgresql.org; Mon, 26 Sep 2016 16:00:12 +0000 Received: from mail.treubuch-colonia.de ([195.243.249.203] helo=ns.ddd-do.de) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1boYK4-0003NS-FT for pgsql-performance@postgresql.org; Mon, 26 Sep 2016 16:00:11 +0000 From: "Knels, Udo" To: "pgsql-performance@postgresql.org" Subject: Re: Problem with performance using query with unnest after migrating from V9.1 to V9.2 and higher Thread-Topic: [PERFORM] Problem with performance using query with unnest after migrating from V9.1 to V9.2 and higher Thread-Index: AdH5O1H79waUwOJ+T8+JxfQvcAsxrQbBdU2AACL1roA= Date: Mon, 26 Sep 2016 15:59:58 +0000 Message-ID: References: <1d6ce510f1cf4dfcad73b15ff8ff98a4@EXCH-1.ddd-do.de> <283046e4-a37f-d8cb-85dc-52d1286e8ffb@BlueTreble.com> In-Reply-To: <283046e4-a37f-d8cb-85dc-52d1286e8ffb@BlueTreble.com> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [172.16.1.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hi, Thank you very much for your answers. Yes, 50 rows aren't enough, but the original table has about 14 million row= s and after analyzing the table I got the same result.=20 We changed our functions and used string_to_array instead of unnest and its= ok.=20 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 fro= m 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 differen= t. So, if we change from one version to another in the future, we have to c= heck the PostgreSQL-functions if the behaviour of the function or the plann= er 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 --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance