On May 22, 2007, at 6:17 PM, Mike Orr wrote:

>
> Regarding the slowness I was experiencing mapping a select (which
> caused a nested SELECT in the SQL), I converted the inner select to a
> MySQL VIEW and the speed improved dramatically.  The MySQL manual says
> it manages a select against a view by merging them into a single
> select if it can, but it doesn't seem to do that with nested selects.
>
> "EXPLAIN SELECT ... FROM the_view WHERE ..."
> shows it's actually selecting from the underlying table (i.e., it
> lists the real table name), while eanwhile,
> "EXPLAIN SELECT ... FROM (SELECT ... FROM the_table) AS my_alias  
> WHERE ..."
> does two selects rather than merging the SQL into one.
>

well thats pretty awful.  an argument to map against the table  
directly instead of a select.  we do have some new ways to get  
additional columns into a mapping now without it needing to  
encapsulate it (column_property(), add_column(), query.select 
(someselect())), so mapping to selects is not quite as necessary.




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to