I''ve a table with structure like this: id: int field1: varchar(255) field2: int(11) field3: text field4: text field5: varchar(255) field6: varchar(255) assume that this table contains massive contents on field 3 and 4 So any way that I will be able to access this table quicker than my current query? And this is the way I''m access this table: Table.find(:all, :include=> "relate_table") please give me some hint (and I need all fields to display on page) -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Ukrit Himakoon wrote:> I''ve a table with structure like this: > > id: int > field1: varchar(255) > field2: int(11) > field3: text > field4: text > field5: varchar(255) > field6: varchar(255) > > assume that this table contains massive contents on field 3 and 4 > So any way that I will be able to access this table quicker than my > current query? > > > And this is the way I''m access this table: > > Table.find(:all, :include=> "relate_table") > > please give me some hint (and I need all fields to display on page)would anyone mind giving some idea? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Assuming you''re using MySQL these might help you. http://dev.mysql.com/doc/refman/5.1/en/static-format.html http://dev.mysql.com/doc/refman/5.1/en/dynamic-format.html -- Shiv N Gautam On Fri, Jan 16, 2009 at 2:17 PM, Ukrit Himakoon < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Ukrit Himakoon wrote: > > I''ve a table with structure like this: > > > > id: int > > field1: varchar(255) > > field2: int(11) > > field3: text > > field4: text > > field5: varchar(255) > > field6: varchar(255) > > > > assume that this table contains massive contents on field 3 and 4 > > So any way that I will be able to access this table quicker than my > > current query? > > > > > > And this is the way I''m access this table: > > > > Table.find(:all, :include=> "relate_table") > > > > please give me some hint (and I need all fields to display on page) > > > > would anyone mind giving some idea? > -- > Posted via http://www.ruby-forum.com/. > > > >-- Robert Orben - "To err is human - and to blame it on a computer is even more so." --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Quoting Ukrit Himakoon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > I''ve a table with structure like this: > > id: int > field1: varchar(255) > field2: int(11) > field3: text > field4: text > field5: varchar(255) > field6: varchar(255) > > assume that this table contains massive contents on field 3 and 4 > So any way that I will be able to access this table quicker than my > current query? > > > And this is the way I''m access this table: > > Table.find(:all, :include=> "relate_table") >Table.connection.select_row("SELECT * FROM table, relate_table WHERE table.relate_table_id = relate_table.id") Returns an array of strings. This is from memory. The function name may not be quite correct. HTH, Jeffrey --~--~---------~--~----~------------~-------~--~----~ 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 Thu, Jan 15, 2009 at 8:09 PM, Ukrit Himakoon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I''ve a table with structure like this: > > id: int > field1: varchar(255) > field2: int(11) > field3: text > field4: text > field5: varchar(255) > field6: varchar(255) > > assume that this table contains massive contents on field 3 and 4 > So any way that I will be able to access this table quicker than my > current query? > > > And this is the way I''m access this table: > > Table.find(:all, :include=> "relate_table") > > please give me some hint (and I need all fields to display on page)You can use :select in your calls to find to select specific fields to retrieve data for. Here is a quick writeup on it. * http://www.geekskillz.com/articles/11 Good luck! Cheers, Robby -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails http://www.planetargon.com/ http://www.robbyonrails.com/ aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---