On Fri, 2008-12-12 at 10:29 -0800, erikcw wrote:
> Thanks for all of the responses.  Just wanted to share where I'm at at
> this point:

[... *argh* my eyes!...ok, snipped...]

> This seems to work.  If you know of any performance tweaks I'd love to
> hear about them (however it is incredibly fast compared to my original
> solution).
> 
> The only problem is that "zz" throws a database error.
> (OperationalError: (1054, "Unknown column 'start_rank' in 'field
> list'")) - ant ideas how I can get "zz" working?

All the above looks quite long and involved, so if it works better for
you, great. I'm not going to wade through it all. If things get slower,
reducing it to a simpler example would help. :-)

As for the database error, you can't do that in SQL: your "zz" column
depends on start_rank, which is another output column (a column that
appears only in the select statement). You can only use what are called
"input columns" in computed columns: which basically means direct table
columns and results of nested selects in FROM clauses. This allows
database servers to be *much* more efficient, since they don't have to
process the select columns until the very last moment and they don't
have to work recursively.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to