Re: Compacting SQL queries

2006-09-21 Thread Michael Radziej
Malcolm Tredinnick schrieb: > What is the advantage of doing this? The only saving you're making here > is the amount of data you are sending from your client to the database > server. Since that is generally going to be no worse than over a local > network, the difference between, say, 2K and 1.5

Re: Compacting SQL queries

2006-09-21 Thread Eric Walstad
Hawkeye wrote: > === > (100 chars ~ 25% reduction) ... > My second question is... if we can, is there any real value > (specifically for very large sites)? Our site isn't huge, but it's not small, either (~8M records). Network bandwidth between the web and data servers is very near

Re: Compacting SQL queries

2006-09-21 Thread Malcolm Tredinnick
On Thu, 2006-09-21 at 08:09 -0700, Hawkeye wrote: [...] > Or in the general case (without .values(), all entries are requested): > === > SELECT * FROM `app_object` as `a` WHERE (`a`.`id` = 1) > === > (54 chars ~ 60% reduction) This is generally a bad idea, because it relie

Compacting SQL queries

2006-09-21 Thread Hawkeye
Hi all, I'm wondering if there's a way to generate more compact queries in the DB layer. For example, when I have a model: === class Object(models.Model): bar = models.ForeignKey(...) foo = models.CharField(...) something = models.DateTimeField(...) === Objec