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

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: "Knels, Udo" <U(dot)Knels(at)treubuch-it(dot)de>, "'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-21 21:48:41
Message-ID: 283046e4-a37f-d8cb-85dc-52d1286e8ffb@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 9/19/16 2:29 AM, Knels, Udo wrote:
> The difference is that V9.1 uses Nested Loop and the index table_a_pk.
> V9.2 and higher don’t use the index.

First thing I'd try is running a manual ANALYZE; on the upgraded
database; the 9.2 plan you showed seems to be using default values, so
it thinks it's going to get 100 rows when it's only getting a few.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532) mobile: 512-569-9461

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2016-09-22 02:11:27 Re: query against single partition uses index, against master table does seq scan
Previous Message Jim Nasby 2016-09-21 21:42:04 Re: Strange nested loop for an INSERT