Changes between Initial Version and Version 5 of Ticket #7121


Ignore:
Timestamp:
Jun 16, 2008, 11:29:39 AM (16 years ago)
Author:
Ramiro Morales
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7121

    • Property Summary queryset-rf does not always honor cacheSlicing on QuerySet bypasses result_cache
    • Property Keywords qsrf-cleanup added
  • Ticket #7121 – Description

    initial v5  
    22
    33Method a)
    4 
     4{{{
    55list = Article.objects.filter(id__gt=130).order_by('-id')[0:2]
    66list[0] # Performs SQL query with LIMIT 1
    77list[1] # Performs another SQL query with LIMIT 1 OFFSET 2
     8}}}
    89
    910Method b)
    1011
     12{{{
    1113list = Article.objects.filter(id__gt=130).order_by('-id')[0:2]
    1214list # Performs an SQL query with LIMIT 2
    1315list[0] # Hits the cache
    1416list[1] # Hits the cache
     17}}}
    1518
     19Calling {{{list[0]}}} afterwards will invoke the SQL query with LIMIT 1
     20   Calling {{{list[1]}}} after this will invoke another query with LIMT 1 OFFSET 1
    1621
    17 Calling list[0] afterwards will invoke the SQL query with LIMIT 1
    18    Calling list[1] after this will invoke another query with LIMT 1 OFFSET 1
    19 
    20 b) Calling just "list" afterwards first and then calling list[0] and list[1]
     22b) Calling just "list" afterwards first and then calling {{{list[0]}}} and {{{list[1]}}}
    2123   will honor the cache and therefore only one SQL query gets fired.
    2224
Back to Top