Re: Using RawSQL-Models

2008-05-21 Thread Adrian R.
On 21 Mai, 15:50, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Fri, May 16, 2008 at 9:27 PM, Adrian R. <[EMAIL PROTECTED]> wrote: > > > Okay, so I've got some additional information for you which are > > hopefully useful for you. I've tried to switch to the dev version but > > I don't thi

Re: Using RawSQL-Models

2008-05-21 Thread Russell Keith-Magee
On Fri, May 16, 2008 at 9:27 PM, Adrian R. <[EMAIL PROTECTED]> wrote: > > Okay, so I've got some additional information for you which are > hopefully useful for you. I've tried to switch to the dev version but > I don't think that I'm on the right way right now. I don't mean to be rude, but this

Re: Using RawSQL-Models

2008-05-16 Thread Adrian R.
Okay, so I've got some additional information for you which are hopefully useful for you. I've tried to switch to the dev version but I don't think that I'm on the right way right now. So, here the SQL-code which generates the database view: SELECT tr.*, tp.TestPlanName, (SELECT IF(COUNT(Produ

Re: Using RawSQL-Models

2008-05-16 Thread Adrian R.
On May 15, 3:12 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > First off: support for GROUP BY, SUM and other aggregation functions > is a work in progress. The new QS-RF code contains placeholders to > hold GROUP BY statements, but there isn't a public API to get a GROUP > BY into your qu

Re: Using RawSQL-Models

2008-05-15 Thread Michael Elsdörfer
> So that leads me to my decision to put this SQL-code into a model so > that the query is performed faster than by the view. I think what you might be looking for is a custom (default) manager for your model that adds your base query to each QuerySet interaction. I suppose depending on what that

Re: Using RawSQL-Models

2008-05-14 Thread Russell Keith-Magee
On Wed, May 14, 2008 at 10:10 PM, Adrian R. <[EMAIL PROTECTED]> wrote: > > 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 t

Re: Using RawSQL-Models

2008-05-14 Thread Adrian R.
On 14 Mai, 17:44, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Adrian, disregard my previous question (you're using your own paginator). > > Does your paginator use len(set) or does it use set.count() to determine the > number of items? You should find that the latter has much better > performance

Re: Using RawSQL-Models

2008-05-14 Thread Scott Moonen
Adrian, disregard my previous question (you're using your own paginator). Does your paginator use len(set) or does it use set.count() to determine the number of items? You should find that the latter has much better performance. -- Scott On Wed, May 14, 2008 at 11:36 AM, Adrian R. <[EMAIL PRO

Re: Using RawSQL-Models

2008-05-14 Thread Adrian R.
On 14 Mai, 16:36, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > On May 14, 2008, at 9:26, "Adrian R." <[EMAIL PROTECTED]> > wrote: > > > the problem is as faras I understood it, that the view is first > > processed completely in the > > database before it returns the result-slice. So it takes as long

Re: Using RawSQL-Models

2008-05-14 Thread Scott Moonen
On Wed, May 14, 2008 at 10:26 AM, Adrian R. <[EMAIL PROTECTED]> wrote: > On 14 Mai, 16:18, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > > Adrian, are you displaying all 30,000 entries on the same page? Or are > you > > using some sort of pagination? > > No, they aren't on the same page and I'm usi

Re: Using RawSQL-Models

2008-05-14 Thread Jeremy Dunck
On May 14, 2008, at 9:26, "Adrian R." <[EMAIL PROTECTED]> wrote: > the problem is as faras I understood it, that the view is first > processed completely in the > database before it returns the result-slice. So it takes as long as it > takes without a LIMIT or WHERE. That's the reason why I

Re: Using RawSQL-Models

2008-05-14 Thread Adrian R.
On 14 Mai, 16:18, "Scott Moonen" <[EMAIL PROTECTED]> wrote: > Adrian, are you displaying all 30,000 entries on the same page? Or are you > using some sort of pagination? No, they aren't on the same page and I'm using pagination (and the result can be filtered by different fields), but the proble

Re: Using RawSQL-Models

2008-05-14 Thread Scott Moonen
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

Using RawSQL-Models

2008-05-14 Thread Adrian R.
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 softw