Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Different table for insert and select

0

65 views

In order to improve insert performance and load on server, I've decided to divide a large table into 2. A big table which will only be used for "select" and a smaller table which will be used mainly for "insert" and sometimes also "select". Each time period (I thought about a day) I will merge the smaller table into the big one.

Regrading the big table: is there a way I can improve performance by telling the mysql server it's read-only? Considering it's only for select, can I assume it will handle SELECT in less than 1sec. when it will become ~1e9 rows?

Regarding the small table: any tuning I should do here? what is the best way to develop an automated merge process from the small to the big table (in php)?

asked June 25, 2011 11:07 am CDT
posted via StackOverflow

3 Answers

2
 

Packed ISAM tables are perfect as MySQL readonly tables, but you'll still need the correct indexes for your heavy queries.

But do make sure this is the solution to your problem (and have considered other options, including indexes and partitioning)

answered June 25, 2011 11:23 am CDT
1
 

I believe you don't need this..

If your goal is to give more precedence to the SELECT query you can just do inserts with INSERT DELAYED.

answered June 25, 2011 11:23 am CDT
1
 

I've seen this and similar strategies used for this purpose and it has always been counterproductive. You end up creating complexity with more overhead that you gain. For instance, you are guaranteeing that every record gets inserted at least twice.

Be sure to benchmark carefully and compare to confirm your hypothesis before going too far with this.

answered June 25, 2011 11:23 am CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions