On Thu, Jul 29, 2021 at 9:21 AM Michal Macejko <[email protected]>
wrote:

> Unfortunately 600/100 counts are just from my local machine. The
> production table growing really fast.
>
> I'm afraid that the denormalization is not possible in this case, as
> MemberIntegrationFields are very dynamic.
>
> I'm running more tests in ActiveRecord and it was just a luck that it
> worked there.
>
> :Member.includes(member_integrations: [:member_integration_fields]).order('
> member_integration_fields.id').limit(50).count
>
> returns 43.
>
> Any other idea, how to fetch these members?
>

Assuming you want 50 members and not 43, did you try the suggestion I gave
with the subselect:

  nodes.where{|o| o.members[:id] =~ nodes.select{members[:id]}.
distinct.from_self.limit(50)}

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CADGZSScrL1e5a%3DbLciviAgrsnhtWYYXv6KMXhRQ-jTU9UKgCxQ%40mail.gmail.com.

Reply via email to