On Thursday, September 1, 2016 at 9:42:11 AM UTC-7, Trevor Turk wrote:
>
> On Thursday, September 1, 2016 at 11:34:44 AM UTC-5, Trevor Turk wrote:
>>
>> In my case, I'm on AWS RDS PostgreSQL version 9.3.10 and I'm using the 
>> "sequel" and "pg" gems. So, I'd be using cursors with paged_each as it 
>> stands. Do you know if that ought to be safe? I'm considering switching to 
>> the "sequel_pg" gem for the streaming support, but I'm reluctant to change 
>> things unnecessarily, unless streaming might work where cursors would not. 
>>
>> Thanks again,
>> - Trevor
>>
>  
> Apologies, I just noticed that "pg" is required for "sequel_pg" so I'll 
> give that a try now :)
>

Streaming should be faster, so that's one reason to use sequel_pg. 
 Streaming also only executes a single query on the database instead of 
multiple queries.  I would recommend using sequel_pg in general due to the 
other optimizations it uses.

I think either using cursors or stream should be safe in terms of not 
locking the whole table, unless you are using SELECT FOR UPDATE, but again, 
that's something you should test to make sure

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.

Reply via email to