Re: [GENERAL] Why so long?

2017-04-20 Thread Rafia Sabih
On Wed, Apr 19, 2017 at 8:54 PM, Steve Clark wrote: > Hello, > > I am confused. I have a table that has an incrementing primary key id. > > When I select max(id) from table is returns almost instantly but > when I select min(id) from table it takes longer than I want

Re: [GENERAL] Why so long?

2017-04-19 Thread David Rowley
On 20 April 2017 at 03:24, Steve Clark wrote: > pmacct=# explain select min(id) from netflow; >QUERY PLAN >

Re: [GENERAL] Why so long?

2017-04-19 Thread Steve Clark
On 04/19/2017 11:57 AM, Jeff Janes wrote: > On Wed, Apr 19, 2017 at 8:24 AM, Steve Clark > wrote: > > Hello, > > I am confused. I have a table that has an incrementing primary key id. > > When I select max(id) from table

Re: [GENERAL] Why so long?

2017-04-19 Thread Jeff Janes
On Wed, Apr 19, 2017 at 8:24 AM, Steve Clark wrote: > Hello, > > I am confused. I have a table that has an incrementing primary key id. > > When I select max(id) from table is returns almost instantly but > when I select min(id) from table it takes longer than I want

Re: [GENERAL] Why so long?

2017-04-19 Thread Steve Clark
Should add this is version 9.4.10 of postgresql On 04/19/2017 11:24 AM, Steve Clark wrote: > Hello, > > I am confused. I have a table that has an incrementing primary key id. > > When I select max(id) from table is returns almost instantly but > when I select min(id) from table it takes longer

[GENERAL] Why so long?

2017-04-19 Thread Steve Clark
Hello, I am confused. I have a table that has an incrementing primary key id. When I select max(id) from table is returns almost instantly but when I select min(id) from table it takes longer than I want to wait. Shouldn't postgresql be able to quickly find the minimum id value in the index?