Domingo,

Thanks for the email, but I don't think I am your inteded recipient.

Ken


On 01/10/2017 12:11 PM, Domingo Alvarez Duarte wrote:
Hello Richard !

Now that you are dealing with this ticket http://www.sqlite.org/src/info/c92ecff2ec5f1784 could be a good moment to acknowledge the problem reported before (see bellow), I'm not sure why you have answered this way without acknowledge any further action on it. I was expecting a bug ticket for it or at minimum a documentation of this weird behavior of the sqlite3 planner so other people could be aware of it.

Cheers !

===

On 1/5/17, Domingo Alvarez Duarte<mingo...@gmail.com> wrote:

Hello !

Today I found this unexpected behavior when using sqlite3 trunk:

When using views with joins sqlite3 is choosing expected plans except
for "LEFT JOIN", bellow is the snippet that shows this unexpected behavior.

===

create table if not exists a(id integer primary key, val text);
create table if not exists b(id integer primary key, a_id integer not
null, val text);
create view if not exists b_view as select b.*, a.* from b left join a
on b.a_id=a.id;
create table if not exists c(id integer primary key, b_id integer not
null, val text);

select 'bad unexpected plan';
explain query plan select c.*, b_view.* from c left join b_view on
c.b_id=b_view.id;

Can you rewrite your query as:

  SELECT *
   FROM c LEFT JOIN b ON c.b_id=b.id
                LEFT JOIN a ON b.id=a.id;
-- D. Richard Hipp

===

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to