Question - When a large sql query is run and it returns to a @results array how large can this be? Is there a better method of storing this info? I can limit the Browsers display with Pagination but I''m concerned on the Array storing. My current query is a date range query. If you select a large enough value the returned result could be very large and over time it will continue to grow for sure. What other ways can a large query be handled in ROR? Thanks Sc- --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 Jun 2008, at 13:21, scottc12 wrote:> > Question - When a large sql query is run and it returns to a @results > array how large can this be? Is there a better method of storing this > info? I can limit the Browsers display with Pagination but I''m > concerned on the Array storing.''How long is a piece of string?''. I don''t think there is a hard limit other than memory, but you''ll probably hit usability limits before (eg a page showing 10,000 rows of data would be horrible to use). If you''re doing your pagination right, at any point you will only have the data for the current page in memory. Fred> > > My current query is a date range query. If you select a large enough > value the returned result could be very large and over time it will > continue to grow for sure. What other ways can a large query be > handled in ROR? > > Thanks > Sc- > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Frederick -- Super quick response. So far I have enabled my page view results to be 50 , toss up a warning on the collected results total and its working. But the array itself still contains the entire set correct?sc On Fri, Jun 27, 2008 at 8:32 AM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 27 Jun 2008, at 13:21, scottc12 wrote: > > > > > Question - When a large sql query is run and it returns to a @results > > array how large can this be? Is there a better method of storing this > > info? I can limit the Browsers display with Pagination but I''m > > concerned on the Array storing. > > ''How long is a piece of string?''. I don''t think there is a hard limit > other than memory, but you''ll probably hit usability limits before (eg > a page showing 10,000 rows of data would be horrible to use). If > you''re doing your pagination right, at any point you will only have > the data for the current page in memory. > > Fred > > > > > > My current query is a date range query. If you select a large enough > > value the returned result could be very large and over time it will > > continue to grow for sure. What other ways can a large query be > > handled in ROR? > > > > Thanks > > Sc- > > > > > > > >-- Scott Comboni President Zenplex Inc. 132 Pepes Farm Road Unit #6 Milford CT, 06460 --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 27 Jun 2008, at 13:36, Scott Comboni wrote:> Thanks Frederick -- Super quick response. So far I have enabled my > page view results to be 50 , toss up a warning on the collected > results total and its working. But the array itself still contains > the entire set correct?It depends on what you''re doing. I certainly wouldn''t load the whole collection only to use 50 of them. Things like will_paginate will get this right for you Fred> sc > On Fri, Jun 27, 2008 at 8:32 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > wrote: > > > On 27 Jun 2008, at 13:21, scottc12 wrote: > > > > > Question - When a large sql query is run and it returns to a > @results > > array how large can this be? Is there a better method of storing > this > > info? I can limit the Browsers display with Pagination but I''m > > concerned on the Array storing. > > ''How long is a piece of string?''. I don''t think there is a hard limit > other than memory, but you''ll probably hit usability limits before (eg > a page showing 10,000 rows of data would be horrible to use). If > you''re doing your pagination right, at any point you will only have > the data for the current page in memory. > > Fred > > > > > > My current query is a date range query. If you select a large enough > > value the returned result could be very large and over time it will > > continue to grow for sure. What other ways can a large query be > > handled in ROR? > > > > Thanks > > Sc- > > > > > > > > > > -- > Scott Comboni > President > Zenplex Inc. > 132 Pepes Farm Road Unit #6 > Milford CT, 06460 > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks again -- Thats exactly what I''m using. I just watched a railscast on Endless pagination. Very nice indeed. Sc- On Jun 27, 8:50 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 27 Jun 2008, at 13:36, Scott Comboni wrote: > > > Thanks Frederick -- Super quick response. So far I have enabled my > > page view results to be 50 , toss up a warning on the collected > > results total and its working. But the array itself still contains > > the entire set correct? > > It depends on what you''re doing. I certainly wouldn''t load the whole > collection only to use 50 of them. Things like will_paginate will get > this right for you > > Fred > > > sc > > On Fri, Jun 27, 2008 at 8:32 AM, Frederick Cheung <frederick.che...@gmail.com > > > wrote: > > > On 27 Jun 2008, at 13:21, scottc12 wrote: > > > > Question - When a large sql query is run and it returns to a > > @results > > > array how large can this be? Is there a better method of storing > > this > > > info? I can limit the Browsers display with Pagination but I''m > > > concerned on the Array storing. > > > ''How long is a piece of string?''. I don''t think there is a hard limit > > other than memory, but you''ll probably hit usability limits before (eg > > a page showing 10,000 rows of data would be horrible to use). If > > you''re doing your pagination right, at any point you will only have > > the data for the current page in memory. > > > Fred > > > > My current query is a date range query. If you select a large enough > > > value the returned result could be very large and over time it will > > > continue to grow for sure. What other ways can a large query be > > > handled in ROR? > > > > Thanks > > > Sc- > > > -- > > Scott Comboni > > President > > Zenplex Inc. > > 132 Pepes Farm Road Unit #6 > > Milford CT, 06460--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---
You can limit the rows returned by changingf the find(:all) in the controller to a more appropriate number of records. On Jun 27, 7:21 am, scottc12 <scomb...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Question - When a large sql query is run and it returns to a @results > array how large can this be? Is there a better method of storing this > info? I can limit the Browsers display with Pagination but I''m > concerned on the Array storing. > > My current query is a date range query. If you select a large enough > value the returned result could be very large and over time it will > continue to grow for sure. What other ways can a large query be > handled in ROR? > > Thanks > Sc---~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---