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 relies on column orders not
changing and/or the client-side knowing what the column orders are. It
also assumes that the only fields in the table are the ones known to the
Django model (which is not always true).

> So, my first question is... is this possible?

Nothing's impossible.

> 
> My second question is... if we can, is there any real value
> (specifically for very large sites)?

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.5K (in the big case) is
really nothing, compared to the time to run the query, return the
results, process the request back to the user, etc. Have you benchmarked
something that shows this really speeds things up noticeably?

I'm -1 on this; a fair bit of work for no real gain.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to