pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Abadie Lana <Lana.Abadie@iter.org>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: pgsql-performance@lists.postgresql.org <pgsql-performance@lists.postgresql.org>
Subject: Re: select query does not pick up the right index
Date: Wed, 9 Jan 2019 19:22:45 +0000
Message-ID: <9036cbbff60c4fbe978e4a1b825feca0@iter.org> (raw )
In-Reply-To: <CAKJS1f-SNU5jFQ0ivmYmgsP9fQ+BT7THgxY7jsr2w2Mt=60YxA@mail.gmail.com >
References: <49406fb0c239480980ffc6c2a250d4e9@iter.org >
<CAKJS1f_h27-bR8P2sW5iAmjY9fhXs_d5DcjQ=zX0AW8WghUcZw@mail.gmail.com >
<438dcc57f91d4a9fab12ae4078592d69@iter.org >
<CAKJS1f9UhO+=nwsJ5rzpQk_BNfSB=u3tnPoS5AJc2A9BNz136Q@mail.gmail.com >
<d34298e7593d40fea9fcf8ab82bb0eea@iter.org >
<20190103234743.GU25379@telsasoft.com >
<7e1a311617e441d2a40dc97fa9766753@iter.org >
<399cd3f79a704b21a47e4305cebfa727@iter.org >
<20190105042357.GK25379@telsasoft.com >
<87705cc87ff74d6d9089adf227c5a9fb@iter.org >
<20190108081528.GF25379@telsasoft.com >
<2ff1004f5faa4c9a841cb29c90473251@iter.org >
<CAKJS1f-SNU5jFQ0ivmYmgsP9fQ+BT7THgxY7jsr2w2Mt=60YxA@mail.gmail.com >
Oups wrong copy and paste. I did run your query with equal instead of in but it resulted in the same plan
________________________________
From: David Rowley <david.rowley@2ndquadrant.com>
Sent: 09 January 2019 17:41:24
To: Abadie Lana
Cc: Justin Pryzby; pgsql-performance@lists.postgresql.org
Subject: Re: select query does not pick up the right index
On Thu, 10 Jan 2019 at 01:55, Abadie Lana <Lana.Abadie@iter.org> wrote:
> The other query suggested by D.Rowley has the same issue : still swap activity is higher.
> explain analyze select 'BUIL-B36-VA-RT-RT1:CL0001-2-ABW', c.smpl_time,c.nanosecs,c.float_val,c.num_val,c.str_val,c.datatype,c.array_val from sample c where c.channel_id in (select channel_id from channel where name ='BUIL-B36-VA-RT-RT1:CL0001-2-ABW') order by c.smpl_time desc limit 5;
This is not the query I suggested. I mentioned if channel.name had a
unique index, you'd be able to do WHERE c.channel_id = (select
channel_id from channel where name = '...'). That's pretty different
to what you have above.
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
view thread (21+ messages)
Message-ID: <9036cbbff60c4fbe978e4a1b825feca0@iter.org>
Permalink: ../9036cbbff60c4fbe978e4a1b825feca0@iter.org/
Also on: postgresql.org/message-id/9036cbbff60c4fbe978e4a1b825feca0@iter.org
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: Lana.Abadie@iter.org, david.rowley@2ndquadrant.com, pryzby@telsasoft.com, pgsql-performance@lists.postgresql.org
Subject: Re: select query does not pick up the right index
In-Reply-To: <9036cbbff60c4fbe978e4a1b825feca0@iter.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox