# Strategy for dealing with large db tables

**URL:** <https://www.ruby-forum.com/t/strategy-for-dealing-with-large-db-tables/154313>\
**Category:** Rails\
**Created:** [November 27, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/strategy-for-dealing-with-large-db-tables/154313 "2008-11-27T16:15:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arfon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@arfon](https://www.ruby-forum.com/u/arfon)\
**Post date:** [November 27, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/strategy-for-dealing-with-large-db-tables/154313/1 "2008-11-27T16:15:29Z")

</div>

I’m looking at building a Rails application which will have some pretty  
large tables with upwards of 500 million rows. To keep things snappy  
I’m currently looking into how a large table can be split to more  
manageable chunks. I see that as of MySQL 5.1 there is a partitioning  
option and that’s a possible option but I don’t like the way the column  
that determines the partitioning has to be part of the primary key on  
the table.

What I’d really like to do is split the table that a AR model writes to  
based upon the values written but as far as I am aware there is no way  
to do this - does anyone have any suggestions as to how I might  
implement this or any alternative strategies?

Thanks

Arfon

---

<div class="post-metadata">

**Author:** ![arfon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@arfon](https://www.ruby-forum.com/u/arfon)\
**Post date:** [November 27, 2008, 8:57pm UTC](https://www.ruby-forum.com/t/strategy-for-dealing-with-large-db-tables/154313/2 "2008-11-27T20:57:20Z")

</div>

Arfon - you might check this out:

> **[Collection of PostgreSQL Performance Tips](https://www.postgresql.org/message-id/53386E0C47E7D41194BB0002B325C997747385@NTEX60)**
>
> This is a collection of many performance tips that we've gathered together at Affymetrix, and I thought it would be …

It’s somewhat dated and deals with postgresql but

" We currently have about 100GB of data and will soon grow to a multi-  
terabyte system. We have tables of up to 1 billion rows and have been  
able to get ~1 million row queries to run in about 5 min. "

Rick

On Nov 27, 5:15 am, Arfon S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
