1

I have a huge table in a database and I want to split that into several parts physically, maintaining the database scheme.

For example, the table name is TableName and has 2 000 000 rows.

I would like to split that table into four parts, but I want to work in the same way with the table, so

select [Column List] from TableName where [Filter]

insert into TableName ([Column List]) values([Values])

update TableName [Updates] where [Filter]

delete from TableName where [filter]

would work in the same way after splitting the table as before. Basically I want my database to handle in different threads my queries. How can I achieve this?

Thanks in advance.

2
  • 1
    As mentioned by Hammerite partitioning would be much better solution. However, 2 000 000 is not all that much and with good indexes and well designed queries shouldn't work slow at all. Commented Sep 20, 2010 at 12:50
  • The problem is that several selects are done by an authomatic project which is running on five threads on each of several servers and the table has a lot of columns too. Sometimes it takes ages to do some simple commands in the database. So we are not talking about running a select query, we are talking about running dozens of queries per second or even more, copying the data to a slave duplicae which is shown on a website. So, in our case, partitioning is the only option. The table is indexed. Commented Sep 20, 2010 at 13:05

2 Answers 2

5

Perhaps you should look at partitioning.

Sign up to request clarification or add additional context in comments.

Comments

1

If you are looking into copying data to a separate slave / duplicate; consider implementing that by binary logging, so the replica will read the binary logs to do the replication, rather than doing it manually or programmatically.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.