Ruby on Rails Thursday, June 28, 2012

Hello,

I know in ruby that when you want to find the size of your query say

[1,2,3,4,5,6] would provide 6 as the total size, length, or even count.

When I try to use size, length, or count on my application, I would get
a pretty darn slow performance (takes around 10 seconds to load each
count and I do it twice). Is there another faster way to get the total
size from the postgres query?

I am using this kind of format in database

e.g: table population [id, race id]
table race [id, persons id]
table persons[id, likes]

so if I use "population.race.persons.count" I would get the total size
of the persons in that particular race and population.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

No comments:

Post a Comment