Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c4BbH-0002Wr-R2 for pgsql-admin@arkaria.postgresql.org; Tue, 08 Nov 2016 18:58:28 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c4BbG-0000GU-Qi for pgsql-admin@arkaria.postgresql.org; Tue, 08 Nov 2016 18:58:26 +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 1c4BZZ-0005TF-9n for pgsql-admin@postgresql.org; Tue, 08 Nov 2016 18:56:41 +0000 Received: from mail-by2nam01on0040.outbound.protection.outlook.com ([104.47.34.40] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c4BZR-0000BN-Py for pgsql-admin@postgresql.org; Tue, 08 Nov 2016 18:56:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prcpglobal.onmicrosoft.com; s=selector1-perceptron-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nzXPBzYR50GpIqn01ZgZAYS+DTdyRjsUPJ0VuSEq41c=; b=D5PI5LbL0c+Z9K+JpibWrGXlZBkLz41HBcDS+mUqoJxSrnJtA62pfTm5q1b8amR1hgF4OKg9t3t5jNCIgGoP35xhn/TdQNeC4OAu/IQUWAZl3zCFYwtkHnDclHStkujvcCt41R5u0koknPilmuSoNbR3mj4DFuHx0WBclV91ptM= Received: from MWHPR07MB2877.namprd07.prod.outlook.com (10.169.231.13) by MWHPR07MB2878.namprd07.prod.outlook.com (10.169.231.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6; Tue, 8 Nov 2016 18:56:31 +0000 Received: from MWHPR07MB2877.namprd07.prod.outlook.com ([10.169.231.13]) by MWHPR07MB2877.namprd07.prod.outlook.com ([10.169.231.13]) with mapi id 15.01.0707.006; Tue, 8 Nov 2016 18:56:31 +0000 From: Igor Neyman To: ghiureai , "pgsql-admin@postgresql.org" Subject: Re: PG 9..5 index performance Q's Thread-Topic: [ADMIN] PG 9..5 index performance Q's Thread-Index: AQHSOe6JAD51gfKawUuM2LqYBBTrl6DPbvsQ Date: Tue, 8 Nov 2016 18:56:30 +0000 Message-ID: References: <582219F1.9030502@nrc-cnrc.gc.ca> In-Reply-To: <582219F1.9030502@nrc-cnrc.gc.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=ineyman@perceptron.com; x-originating-ip: [68.22.13.253] x-ms-office365-filtering-correlation-id: badb8dcc-7868-492d-7170-08d40808f411 x-microsoft-exchange-diagnostics: 1;MWHPR07MB2878;7:Uz9rQCfiyrNsBJ0yvuUNtw85Erwc4MENuuDZObVmgY4LLY1EMX7RcpePh/gwUBLUZ5DU0hg8P7oKiQ4K/GWsy34MKMPr44zVISk2tbhEer1IO3krMIrMF1tjz7mLLeza8chrpSx7KnKfgvuB3FRKma9ZseE0aXY/9RsMuBk792Gs+N0guEHRH/G6bgmj4fHl5/IFSAaWjyBwHC5uGlULmq3CxtLd8byhCAB7xaTdh2KTBG1g6kcewRl5YhfeiWqdceWZ/q1qUoumoa8Sfb6ffKt4e/duJKSX/xgBOwpmpvq2dvy8Sbp2kPfANXCoFOBln5xXV1jWt0B/jOUKSMqGlIv3VusApMDeiJU87tVG20Y= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:MWHPR07MB2878; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:MWHPR07MB2878;BCL:0;PCL:0;RULEID:;SRVR:MWHPR07MB2878; x-forefront-prvs: 01208B1E18 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(13464003)(377454003)(189002)(199003)(54356999)(76576001)(81166006)(74316002)(8676002)(33656002)(3660700001)(81156014)(76176999)(50986999)(68736007)(7736002)(7846002)(3280700002)(189998001)(99286002)(305945005)(101416001)(97736004)(122556002)(5001770100001)(105586002)(107886002)(106116001)(2501003)(86362001)(7696004)(6116002)(102836003)(3846002)(586003)(87936001)(106356001)(8936002)(66066001)(2906002)(2900100001)(77096005)(2950100002)(9686002)(92566002)(5660300001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR07MB2878;H:MWHPR07MB2877.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: perceptron.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: perceptron.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2016 18:56:30.4659 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 5a3f4b27-4352-46d0-8e0b-2323c542f5d0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB2878 X-Pg-Spam-Score: -4.5 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql= .org] On Behalf Of ghiureai Sent: Tuesday, November 08, 2016 1:31 PM To: pgsql-admin@postgresql.org Subject: [ADMIN] PG 9..5 index performance Q's Hi List, running PGSQL 9.5.1 ( EL7) , we are seeing a issues with one of our SQL statement getting the wrong=20 plan once in a while ( large temp tables being generate, exec time=20=20=20 takes > 3 minutes compared with fastes plan < 1 min), we want to undestand= why a new/ expensive plan is been used instead of efficient one, there are= not data changes on the tables, any tips where to look? Second , I would like to know if when re-creating one index ( non pk ) on = a large table with already existing indexes, are All tables statistics be= ing re-generated? ( there is a way to control persistency of old stats?) Isabella ___________________________________________________________________________= __________________________________________ Without seeing execution plans (both: fast and slow) it's hard to tell. Auto_explain extension can help you catching these plans in PG log. Your temp tables - are they being analyzed? Regards, Igor Neyman=20 --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin