I understand. Let`s say I set rows_per_fetch to 1. and limit 100 to dataset select. in log file I see only one query. It's weird. If I copy paged_each method to my project – everything works as expected. I can see limits and offsets.. I will try to switch to older version and test again
On Thursday, March 15, 2018 at 4:00:33 PM UTC+2, Jeremy Evans wrote: > > On Thursday, March 15, 2018 at 12:19:18 AM UTC-7, matas.si...@ksdigital.lt > <javascript:> wrote: >> >> Hi, I understand that. But paged_each is selecting whole table instead in >> batches. Maybe it's because I connect additional servers? Im fetching >> additional server`s database. >> > > The query does select the whole table, but results are streamed using > Mysql2 streaming support. This is equivalent to a batch size of 1. You > don't see the batching, as it's not done with separate queries, but > internally. > > At the risk of being redundant: The purpose of paged_each is to iterate > over large result sets without keeping all rows in memory. The default > implementation of paged_each uses LIMIT/OFFSET since that should work on > all databases. paged_each can be made to use ORDER BY and WHERE, which > should also work on all databases. However, if streaming results is > supported, that's usually the fastest approach and the default where it is > supported. > > Thanks, > Jeremy > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to sequel-talk+unsubscr...@googlegroups.com. To post to this group, send email to sequel-talk@googlegroups.com. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.