On 11/07/2006, at 12:22 PM, Malcolm Tredinnick wrote:

>>
>> is this totally out of line?
>> or should I just be using the 'regular' cache here.
>
> Tricky implementation ("tricky" != "bad"), but it looks like it should
> work more or less. Don't you need to override every public method of
> QuerySet, not just get() (e.g. filter(), order_by()...)?
>

I was relying on my own usage pattern on those small tables which is  
either  get them all or get a specific one.
filter() would be the painful one.
> In a long running process, memory usage is going to be an issue.  
> You are
> essentially caching the results of every single query during the  
> runtime
> of the process, aren't you? So if I retrieve something that  
> temporarily
> sucks in a couple of thousand lines of data and I only need it once, I
> pay the memory penalty forever. A "sorted dict" structure that allows
> you to remove the oldest entries easily would work around this  
> somewhat
> (managing total memory usage wouldn't be easy, but you could manage  
> the
> number of cached querysets). I'm a little concerned about whether an
> "active" application is just going to end up thrashing the cache a lot
> without seeing any real benefit, but the overhead of that should  
> not be
> too much. And it's testable once we have an implementation anyway.
>

It should be ok memory wise.. as long as you don't have many access  
paths. I'm guessing you would only have 2-3 ways of hitting a  
particular table, and only 10-15 rows in them.
but I'll adjust it to use adrians/jacob's recommendation of using the  
cache architecture. the idea behind this was to just make it as fast  
as a dictionary access without having
to go out of process.

> I think your idea is probably worthwhile.
thx.
>
> 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