On Sat, 13 Apr 2013 20:08:16 +0200
Rikard Pavelic wrote:
> While one could argue that optimizer doesn't know to optimize left
> join with group by its primary key, you can replace that join with
> some other joins (ie left join to another table pk) and the same
> behavior will be displayed (joini
On Sat, 13 Apr 2013 11:21:19 -0400
Tom Lane wrote:
> The planner realizes that about 1/200th of the table satisfies the
> "ord" condition, so it estimates that the first plan will require
> scanning about 2000 entries in the pkey index to get 10 results. So
> that looks significantly cheaper tha
On 13/04/13 18:25, Rikard Pavelic wrote:
> I was investigating some performance issues and stumbled upon this behavior:
>
> create table main_table (i serial primary key, data varchar, ord int);
> create view main_view_order as select m.i, m.data, m.ord from main_table m
> order by m.i desc;
>
>
Rikard Pavelic writes:
> I was investigating some performance issues and stumbled upon this behavior:
> create table main_table (i serial primary key, data varchar, ord int);
> create view main_view_order as select m.i, m.data, m.ord from main_table m
> order by m.i desc;
> insert into main_tabl
I was investigating some performance issues and stumbled upon this behavior:
create table main_table (i serial primary key, data varchar, ord int);
create view main_view_order as select m.i, m.data, m.ord from main_table m
order by m.i desc;
insert into main_table select i, i::text, i/10 from ge