Re: [HACKERS] Limit and inherited tables

2016-01-17 Thread Ashutosh Bapat
On Fri, Jan 15, 2016 at 9:47 PM, Konstantin Knizhnik < k.knizh...@postgrespro.ru> wrote: > > This example is lacking indexes on the child tables, which is >> why the plan shown is about as good as you're going to get. >> The contents of foo1 and foo2 have to be read in entirety in any >> case,

Re: [HACKERS] Limit and inherited tables

2016-01-15 Thread Tom Lane
Konstantin Knizhnik writes: > I noticed that LIMIT clause is not pushed down to inherited tables. It is when appropriate. > Consider the following tables: > create table foo(x integer primary key); > create table foo1 () inherits(foo); > create table foo2 ()

[HACKERS] Limit and inherited tables

2016-01-15 Thread Konstantin Knizhnik
Hi, I am sorry if this question was already discussed but I failed to find any information about in archive. I noticed that LIMIT clause is not pushed down to inherited tables. Consider the following tables: create table foo(x integer primary key); create table foo1 () inherits(foo); create

Re: [HACKERS] Limit and inherited tables

2016-01-15 Thread Konstantin Knizhnik
This example is lacking indexes on the child tables, which is why the plan shown is about as good as you're going to get. The contents of foo1 and foo2 have to be read in entirety in any case, and sorting them separately is not a win compared to doing a single sort. It is true, but not in case

Re: [HACKERS] Limit and inherited tables

2016-01-15 Thread Tom Lane
Konstantin Knizhnik writes: >> This example is lacking indexes on the child tables, which is >> why the plan shown is about as good as you're going to get. >> The contents of foo1 and foo2 have to be read in entirety in any >> case, and sorting them separately is not a