Adrian, are you displaying all 30,000 entries on the same page? Or are you using some sort of pagination?
-- Scott On Wed, May 14, 2008 at 10:10 AM, Adrian R. <[EMAIL PROTECTED]> wrote: > > Hello Django developers, > > I'm new to this mailing list and I hope that I didn't fail completely > by searching the django groups while I was considering to discuss this > on the list: > > At the moment (like since 1.5 years) I'm working on a web interface > which is used to control some options for a software testing backend > using Django 0.96.1 on an Apache 2 with Python 2.5.1 and MySQL 5.0.24. > > For that I've created a database view for one (the biggest and most > used) page containing seven "LEFT JOIN" and a "GROUP BY" and some > SUM()- and IF()-fields which takes about 5 seconds for more than > 30,000 entries in the database. The problem is, that this time is also > taken if I use LIMIT or WHERE conditions (e.g. SELECT * from MyView > where State='FAILED') - which is as I think a MySQL limitation - but > if I enter the SQL statement of the view directly using a where > condition the performance is much better (taking 0.15 seconds). > > So my plan was to create a "SQL-Model" which consists of a MySQL-Query > to get the data but which supports the normal methods like filter() > and extra() if possible. First I didn't want to touch the django > sources due to the fact that I'd have to maintain it on every Django > update if you'd not want to take it into the Django repos, but I > couldn't find a good solution how to get that model without doing it, > so I want to do so.. > > And now I'm sitting here and ask you if there is a possibility to use > JOIN and GRUOP BY and some SUM()- and IF()-fields right now using > QuerySets and custom models and/or a custom manager or if it's planned > for Django. If not, I'd like to know if it would be possible to > integrate it into the normal Django branch if I'd start developing it. > I thought about something like a Model.RawSQL-class or something like > that and some modifications to the QuerySet() but I'm not so > experienced with the Django source (most notably not with the dev- > branch) and so you'll probably have better ideas how to implement > something like that. Comments, corrections, improvements and > additional requirements are very welcome;) > > Best regards from Karlsruhe, Germany > - Adrian > > > -- http://scott.andstuff.org/ | http://truthadorned.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---