Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gf2Zg-0003b9-94 for pgsql-performance@arkaria.postgresql.org; Thu, 03 Jan 2019 12:58:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gf2Zf-0001ci-0i for pgsql-performance@arkaria.postgresql.org; Thu, 03 Jan 2019 12:58:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gf2Ze-0001cb-Pw for pgsql-performance@lists.postgresql.org; Thu, 03 Jan 2019 12:58:10 +0000 Received: from smtp1.iter.org ([193.51.56.7]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gf2Zc-0002ll-AF for pgsql-performance@lists.postgresql.org; Thu, 03 Jan 2019 12:58:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iter.org; l=1624; q=dns/txt; s=20170425; t=1546520288; x=1547125088; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=PavMs9tE6YXOT2MygHBJXtgQHfDFd0rOgqqkHipcDTk=; b=B8A5jP0S2ncX9FdiHkqmIkjPM3yP5b+1PAuJMX1a7SuDl6K4NXnWNoOB kFzCNSmZd00NqAEAX4c81vGtljPXKy7ERaNLBi4gIKbtqAXdLUQVIe7JX wAXXIurlDK138pgYJLFEZuad1x5ofgALpJJPGPPdMVTtLoJ5bgyDI2t2R w=; Received: from XCH-CLU1N3.iter.org (10.10.242.164) by XCH-CLU1N2.iter.org (10.10.241.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Thu, 3 Jan 2019 13:58:07 +0100 Received: from XCH-CLU1N3.iter.org ([fe80::f903:4e8a:c365:4c74]) by XCH-CLU1N3.iter.org ([fe80::f903:4e8a:c365:4c74%16]) with mapi id 15.01.1261.036; Thu, 3 Jan 2019 13:58:07 +0100 From: Abadie Lana To: Justin Pryzby CC: "pgsql-performance@lists.postgresql.org" Subject: RE: select query does not pick up the right index Thread-Topic: select query does not pick up the right index Thread-Index: AdSitwt5/9TyB7hoTX++E94tUlkiMv//9kOA//6cjtA= Date: Thu, 3 Jan 2019 12:58:06 +0000 Message-ID: <92561fd0a0a846288cb0360ee0ae2505@iter.org> References: <20190102164525.GU25379@telsasoft.com> In-Reply-To: <20190102164525.GU25379@telsasoft.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.14.32.57] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Lana ABADIE Database Engineer CODAC Section ITER Organization, Building 72/4108, SCOD, Control System Division Route de Vinon-sur-Verdon - CS 90 046 - 13067 St Paul Lez Durance Cedex - F= rance Phone: +33 4 42 17 84 02 Get the latest ITER news on http://www.iter.org/whatsnew -----Original Message----- From: Justin Pryzby =20 Sent: 02 January 2019 17:45 To: Abadie Lana Cc: pgsql-performance@lists.postgresql.org Subject: Re: select query does not pick up the right index On Wed, Jan 02, 2019 at 04:28:41PM +0000, Abadie Lana wrote: > css_archive_3_0_0=3D# explain analyze select t.name, c.smpl_time,c.nanose= cs,c.float_val,c.num_ = val,c.str_val,c.datatype,c.array_val from sample c, channe= l t where t.channel_id=3Dc.channel_i = d and t.name=3D'BUIL-B36-VA-RT-RT1:CL0001-2= -ABW' order by c.smpl_time desc limit 5; > QUERY PLAN >=20 > -------------------------------------------------------------------------= ------------------- > -------------------------------------------------------------------------= ------------------- > ------------- > Gather (cost=3D1004.71..125606.08 rows=3D5 width=3D150) (actual time=3D3= 8737.443..1220277.244 rows > =3D3 loops=3D1) > Workers Planned: 1 > Workers Launched: 1 > Single Copy: true Do you have force_parallel_mode set ? http://rhaas.blogspot.com/2018/06/using-forceparallelmode-correctly.html --=20 Justin Pryzby System Administrator Telsasoft +1-952-707-8581 Hi Justin Indeed force_parallel_mode was set to on. Even after disabling it, same iss= ue... cheers