# query performance boost

**URL:** <https://discuss.rubyonrails.org/t/query-performance-boost/38413>\
**Category:** rubyonrails-talk\
**Created:** [January 17, 2009, 4:21am UTC](https://discuss.rubyonrails.org/t/query-performance-boost/38413 "2009-01-17T04:21:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeffrey](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@Jeffrey](https://discuss.rubyonrails.org/u/Jeffrey)\
**Post date:** [January 17, 2009, 4:21am UTC](https://discuss.rubyonrails.org/t/query-performance-boost/38413/1 "2009-01-17T04:21:34Z")

</div>

Quoting Ukrit Himakoon \<rails-mailing-list@andreas-s.net\>:

> 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, &nbsp;&nbsp;Jeffrey
