Re: reduce execution time of object.count()

2007-06-13 Thread Bram - Smartelectronix
simonbun wrote: > If your situation allows it, you could de-normalize and save the count > result in a separate table. Then you need to adjust the count whenever > you add / delete a row ofcourse. We keep a set of 'stats' tables which count various things in the database (nr of comments, number

Re: reduce execution time of object.count()

2007-06-13 Thread Nis Jørgensen
Nis Jørgensen skrev: > > What is missing above is creating INSERT/UPDATE/DELETE rules for the > "entity" view. I hacked together the ones below - they seem to work, > but there might be subtle points of how this works that I have not > understood. > [...] > CREATE RULE entity_insert as ON INS

Re: reduce execution time of object.count()

2007-06-13 Thread Nis Jørgensen
Nis Jorgensen skrev: > Paul Rauch wrote: > >> Is there a way to reduce execution time by counting objects? >> >> it's even splitted in two queries now, with only 2474487 entries ;) >> >> in django I use "model.objects.count()" >> >> SELECT COUNT(*) FROM "rainbowtables_hashes":34.552 >> >> SELEC

Re: reduce execution time of object.count()

2007-06-08 Thread simonbun
If your situation allows it, you could de-normalize and save the count result in a separate table. Then you need to adjust the count whenever you add / delete a row ofcourse. If you're a database purist I might have made your stomach turn, however :) regards, Simon On Jun 7, 8:19 pm, Paul Rauch

Re: reduce execution time of object.count()

2007-06-08 Thread Nis Jorgensen
Paul Rauch wrote: > Is there a way to reduce execution time by counting objects? > > it's even splitted in two queries now, with only 2474487 entries ;) > > in django I use "model.objects.count()" > > SELECT COUNT(*) FROM "rainbowtables_hashes":34.552 > > SELECT COUNT(*) FROM "rainbowtables_hashes

reduce execution time of object.count()

2007-06-07 Thread Paul Rauch
Is there a way to reduce execution time by counting objects? it's even splitted in two queries now, with only 2474487 entries ;) in django I use "model.objects.count()" SELECT COUNT(*) FROM "rainbowtables_hashes":34.552 SELECT COUNT(*) FROM "rainbowtables_hashes":31.024 greetz Paul Rauch --~