Re: select query does not pick up the right index
От | David Rowley |
---|---|
Тема | Re: select query does not pick up the right index |
Дата | |
Msg-id | CAKJS1f-SNU5jFQ0ivmYmgsP9fQ+BT7THgxY7jsr2w2Mt=60YxA@mail.gmail.com обсуждение исходный текст |
Ответ на | RE: select query does not pick up the right index (Abadie Lana <Lana.Abadie@iter.org>) |
Ответы |
Re: select query does not pick up the right index
|
Список | pgsql-performance |
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_valfrom sample c where c.channel_id in (selectchannel_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
В списке pgsql-performance по дате отправления: