Re: [PERFORM] Odd behavior with indices

2016-02-28 Thread Matheus de Oliveira
Em 26 de fev de 2016 4:44 PM, "joe meiring" escreveu: > > The same query for parameters is rather slow and does NOT use the index: > > EXPLAIN ANALYZE > select * > from parameter > where exists ( > select 1 from datavalue > where datavalue.parameter_id = parameter.id limit 1 > ); > Pl

Re: [PERFORM] Merge joins on index scans

2016-02-28 Thread David Rowley
On 27 February 2016 at 11:07, James Parks wrote: > > CREATE TABLE a (id bigint primary key, nonce bigint); > CREATE TABLE b (id bigint primary key, a_id bigint not null); > CREATE INDEX a_idx ON b (a_id); > > The query: > > SELECT b.* FROM b JOIN a ON b.a_id = a.id WHERE a.nonce = ? ORDER BY b.id