On Mar 19, 10:26 am, Marco Mariani <ma...@sferacarta.com> wrote: > someone wrote: > >> Also, for SQL, (A) why are you using nested joins?, and > > > inner select produce smaller set which is then joined with other > > table, kind a optimization > > Did you time it?
I've did explain on both kinds of query (with nested select and without) and query plan is identical to both. So, there is no difference, well in PostGres > I've done some "kind of a optimization" that slowed queries by tenfold, > because postgres didn't need my advice, and knew better. RDBMS > performance is non-intuitive, really. If you're using mysql, YMMV, > because its optimizer is not as good. > > > Yes, my original question was about formatting. It's not original > > query (only a part). > > Try this: > > http://www.dpriver.com/pp/sqlformat.htm > > My 2c: I use textwrap.dedent to strip leading spaces from every line. -- http://mail.python.org/mailman/listinfo/python-list