Great, thanks!
2014-02-26 0:11 GMT-03:00 Richard Hipp-3 [via SQLite] < ml-node+s1065341n74140...@n5.nabble.com>: > On Tue, Feb 25, 2014 at 1:11 PM, nobre <[hidden > email]<http://user/SendEmail.jtp?type=node&node=74140&i=0>> > wrote: > > > Hi! Given this schema: > > > > create table q (id integer primary key, idLevel integer); > > create table level (id integer primary key); > > > > insert into q values(1, 1); > > insert into q values(2, 1); > > insert into q values(3, 1); > > insert into level values(1); > > > > When running this query: > > select p.* FROM > > q as p > > inner join level pn ON (p.idLevel = pn.id) > > where p.idLevel = 1 > > ORDER BY random() LIMIT 10 > > > > The results are not on random order on SQLite 3.8.0.2 > > Verifying with EXPLAIN QUERY PLAN , it can be seen that no ORDER BY step > is > > included. > > > > if one of the following is changed: > > LEFT join level instead of inner or the where clause condition is > changed > > to > > p.idLevel >=1 and p.idLevel <= 1, the Order by step is included in the > > query, and the result order is random as expected. > > > > Anything I'm missing ? > > > > Now fixed on trunk. http://www.sqlite.org/src/info/dca1945aeb > > -- > D. Richard Hipp > [hidden email] <http://user/SendEmail.jtp?type=node&node=74140&i=1> > _______________________________________________ > sqlite-users mailing list > [hidden email] <http://user/SendEmail.jtp?type=node&node=74140&i=2> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://sqlite.1065341.n5.nabble.com/Possible-issue-in-optimizer-strips-away-order-by-tp74134p74140.html > To unsubscribe from Possible issue in optimizer, strips away order by, click > here<http://sqlite.1065341.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=74134&code=bm9icmU4NEBnbWFpbC5jb218NzQxMzR8LTg0MzM5MTQx> > . > NAML<http://sqlite.1065341.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://sqlite.1065341.n5.nabble.com/Possible-issue-in-optimizer-strips-away-order-by-tp74134p74227.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users