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 1gejeB-0007qH-8o for pgsql-performance@arkaria.postgresql.org; Wed, 02 Jan 2019 16:45:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1geje9-0004iF-El for pgsql-performance@arkaria.postgresql.org; Wed, 02 Jan 2019 16:45:33 +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 1geje9-0004gF-0p for pgsql-performance@lists.postgresql.org; Wed, 02 Jan 2019 16:45:33 +0000 Received: from mail-it1-x136.google.com ([2607:f8b0:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1geje5-0000KQ-Dg for pgsql-performance@lists.postgresql.org; Wed, 02 Jan 2019 16:45:32 +0000 Received: by mail-it1-x136.google.com with SMTP id z7so41683374iti.0 for ; Wed, 02 Jan 2019 08:45:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kAv0D3ifumi7XmZlH7kFPIblkR6c2mygKWYkxbsqz0I=; b=mi8WJAIEIKO4T3QgeilcHSGYzqLaObVMyfOW3awRS2iIbdPAjCVBSRmAjAq/k2Fkrq olVijLAdsX0s2RCkI42CmrUJd2RCm0KqiL/FCM9Wn3cy95VAZZnT/bufPv/Vz+KwPuqK Q8Ey3XNXN5+14vmS0yuFyyUWCTfpnzZo8lP+/9bsWVfi5Vmv1ErROotViFELBvBdaS3+ MlQ8GYt1yaeRRmPIeoYlVMEynfAoNTW4PnUgd05eoRUpG8yuXlEJ9onYMO5A1+Py56Tt jy+2AkSpe68T+8bCeaumL0bUOi8UX0iBEedKbiziHELp2Upjk+wa7iZqyjXf0Y/GcSAN aNEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kAv0D3ifumi7XmZlH7kFPIblkR6c2mygKWYkxbsqz0I=; b=sL7wL/ftBOZngZOmhOuAAFC0MfHu2wdgiyBQ2vcJFUPA1ltc8Yrl6i+D0mMukFcx6T 4UuB+vsfU+rYFrYPTNj3yQN/3C27ZskV53DOSQFRvGJ7Vp/zmUvs4CUpewbHp5U4auH3 bT4+0IkCsVDDuGgQNBrTvLqtPs/0h8u9ieyS/fbBZ33CZYNFS7g4Iq8es5baKwtRLZQX /ieVPlAopVfTPihurJ1YDzm3OFbWPUxlErrhUgT4Pw6XnOXrUPu+EPr9RJZLf2hmEMn8 sZ163itnjfjvqwbqV1brbBD1Ied6WqJSR6XK8YSLc9sVcH7tYhEqlIeUbaYaRgkJyuvK Dkew== X-Gm-Message-State: AA+aEWayQ548JvfrhGzuZ8aiOM/1DClggaRpo5D5vsekg1MYJ0Nmu6Ok FucWepbttSwO9hdo0Dp2IwIYks4p+rc= X-Google-Smtp-Source: AFSGD/VZeH5q/lNbpDj4HgeEylIvZovM73JxOlxJUfgE217qGShkqaQvt+3dds+rX8EufhmtudDo0Q== X-Received: by 2002:a24:d902:: with SMTP id p2mr26964704itg.112.1546447527163; Wed, 02 Jan 2019 08:45:27 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id a18sm672525itc.32.2019.01.02.08.45.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Jan 2019 08:45:26 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id B2E768054BB; Wed, 2 Jan 2019 10:45:25 -0600 (CST) Date: Wed, 2 Jan 2019 10:45:25 -0600 From: Justin Pryzby To: Abadie Lana Cc: "pgsql-performance@lists.postgresql.org" Subject: Re: select query does not pick up the right index Message-ID: <20190102164525.GU25379@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Jan 02, 2019 at 04:28:41PM +0000, Abadie Lana wrote: > css_archive_3_0_0=# explain analyze select t.name, c.smpl_time,c.nanosecs,c.float_val,c.num_ val,c.str_val,c.datatype,c.array_val from sample c, channel t where t.channel_id=c.channel_i d and t.name='BUIL-B36-VA-RT-RT1:CL0001-2-ABW' order by c.smpl_time desc limit 5; > QUERY PLAN > > -------------------------------------------------------------------------------------------- > -------------------------------------------------------------------------------------------- > ------------- > Gather (cost=1004.71..125606.08 rows=5 width=150) (actual time=38737.443..1220277.244 rows > =3 loops=1) > 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 -- Justin Pryzby System Administrator Telsasoft +1-952-707-8581