# Rails database performance issue

**URL:** <https://www.ruby-forum.com/t/rails-database-performance-issue/187787>\
**Category:** Rails\
**Created:** [April 29, 2010, 10:14am UTC](https://www.ruby-forum.com/t/rails-database-performance-issue/187787 "2010-04-29T10:14:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TechSlam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecc23a/32.png) [@TechSlam](https://www.ruby-forum.com/u/TechSlam)\
**Post date:** [April 29, 2010, 10:14am UTC](https://www.ruby-forum.com/t/rails-database-performance-issue/187787/1 "2010-04-29T10:14:37Z")

</div>

Hi

I have a Student table with 30 columns in it.

My question is at what database size, would the query performance be  
affected?

We are actually planning to have a ArchivedStudent table(which has  
exactly the same structure as that of Student table) so that when  
student graduates, his record can be moved out of active Student table  
to ArchivedStudent table. or should I just go for named scopes?

---

<div class="post-metadata">

**Author:** ![TechSlam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecc23a/32.png) [@TechSlam](https://www.ruby-forum.com/u/TechSlam)\
**Post date:** [April 29, 2010, 1:31pm UTC](https://www.ruby-forum.com/t/rails-database-performance-issue/187787/2 "2010-04-29T13:31:18Z")

</div>

It entirely depends on your query. If you are just finding by ID, then  
it’s  
likely to be in the 7 figure range (10,000,000+).

If you’re doing complex joins and searches within strings, then you’d  
need  
to test it.

The short answer is test it! It’s easy enough in script/console to  
quickly  
insert a million rows, then actually test/benchmark your app.

Cheers,

Andy

–  
Andy J.  
[http://andyjeffries.co.uk/](http://andyjeffries.co.uk/)#rubyonrails #mysql #jquery  
Registered address: 64 Sish Lane, Stevenage, Herts, SG1 3LS  
Company number: 5452840

---

<div class="post-metadata">

**Author:** ![TechSlam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ecc23a/32.png) [@TechSlam](https://www.ruby-forum.com/u/TechSlam)\
**Post date:** [April 29, 2010, 3:05pm UTC](https://www.ruby-forum.com/t/rails-database-performance-issue/187787/3 "2010-04-29T15:05:35Z")

</div>

TechSlam wrote:

> Hi
> 
> I have a Student table with 30 columns in it.
> 
> My question is at what database size, would the query performance be  
> affected?

Depends on how well, or poorly, crafted the query is? Do you have the  
appropriate indexes defined to support your query? There are numerous  
factors that will determine the actual performance. A classic “it  
depends” question…
