You don't see well the code. The code does caching of
django_contenttype table like the other file. It reduces by caching
this SQL sentence:

obj1.related_object
select * from django_content_types where id = 4 ---> a content type
for one relationship
select * from myapp_mytable where id = 27 ---> this is not NEVER
cached

obj2.related_object
select * from django_content_types where id = 4 ---> a content type
for other relationship (CACHED because id is 4)
select * from myapp_mytable where id = 47 ---> this is not NEVER
cached

On 22 sep, 03:05, Michael Radziej <[EMAIL PROTECTED]> wrote:
> On Fri, Sep 21, msaelices wrote:
>
> > I have uploaded a patch for improve generic relations performance:
>
> >    http://code.djangoproject.com/ticket/5570
>
> > But mir closed my ticket because it think patch is not convenient.
>
> > I think there are a lot of files with same type of caching. I don't
> > use django cache framework. I use a simple dictionary for caching.
>
> > For example you can find caching of contenttypes in this other file:
>
> >http://code.djangoproject.com/browser/django/trunk/django/contrib/con...
>
> > Why is not accepted my patch? Is it not the same like previous file?
>
> There's a difference. The example you refer to uses a cache to cache
> content types, nothing else, and the content types don't change usually.
>
> Your idea would introduce an ever-growing cache for _all_ generic foreign
> key lookups, and then were into something completely different. An example:
>
> First, a view accesses a related object. This is then put into the cache.
> When the the related object is changed in the database, it still is in
> the cache (but out of date).
>
> When you now accesss  the object again in the same way, you get the
> out-dated copy from the cache. This should not happen.
>
> Michael
>
> --
> noris network AG - Deutschherrnstraße 15-19 - D-90429 Nürnberg -
> Tel +49-911-9352-0 - Fax +49-911-9352-100http://www.noris.de- The 
> IT-Outsourcing Company
>
> Vorstand: Ingo Kraupa (Vorsitzender), Joachim Astel, Hansjochen Klenk -
> Vorsitzender des Aufsichtsrats: Stefan Schnabel - AG Nürnberg HRB 17689


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to