Hi,

Thanks for the reply.

I just tested my notorious 38 sec query directly on the MySQL, and it also 
took nearly 40 sec to complete, so after all it was not web2py's fault :-)

Further I also tested *cache_count* option, and indeed like you said, it 
does something very similar to what I need, thank you for hint!
However there are few flaws and very unexpected behaviour:
1) Giving *cache_count* and *paginate* same values (eg. *cache_count=20*
 and *paginate=20*) will yield ALL rows at once, without pagination..
2) If a returned dataset is smaller than a *cache_count* - it will show 
empty pagination breadcrumbs (eg. *cache_count=10;* *paginate=4; dataset=3 
- it will show 3 rows on the first page, but still add pages 2 and 3 in the 
breadcrumbs, even tho they are empty... Clicking on them simply yields '*No 
records found'*)*
3) If cache_count is not a multiple of a paginate, user will be presented 
with cache_count + difference records (eg. *cache_count=10;* *paginate=4; 
will present 12 rows for the user)*
4) If all goes well and I close my eyes to the fact that user will retrieve 
slightly more records than I defined in *cache_count*, there still is a 
problem. If user would click on the table headers to change sort order - he 
would see *cache_count *number of records from the end of full dataset. 
(eg. *cache_count=10;* *paginate=4; returned **dataset=52; in this case 
user will be able to see first **12 rows, then reorder and see last 12 rows 
in the dataset, that is 24 rows in total instead of initially desired 
10...)*

After #4 in my list my initial "Wow" eventually turned into "It's a 
shame"...

Any hints how to get around these bugs?

Thanks





2014 m. spalis 7 d., antradienis 11:32:16 UTC+1, Niphlod rašė:
>
> Those are not identical queries (constraints DO change, not only 
> pagination). Again, 
>
> select a from table limit 10 offset 0
>
> and 
>
> select a from table limit 10 offset 10
>
> SHOULD DEFINITIVELY NOT have different execution times.
>
> And again, if you want 10 pages of 50 records, just pass paginate=50, 
> cache_count = 500 and it'll do EXACTLY what you want.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to