Sync-ing two tables, one for INSERTS, another for SELECT
- From: "L. Berger" <straightfwd007@xxxxxxxxx>
- Date: 11 May 2007 21:20:52 -0700
Hi,
I hope some experts can shed some light on this.
I have a table that is very INSERT-heavy. Most of the days, it only
needs to accept data, almost like a running log. About 500,000 INSERTs
a day.
Because this is such a rapidly growing table, SELECTing from this is
a
huge pain. There are 24 columns, and the SELECTing needs to happen
from several of them, so we have 9 indexes.
These indexes mean that the performance of the table is pretty lousy.
So now I have two tables -- A and B. The structure of both is the
*same*.
Only, B has many indexes and is used for heavy duty SELECTs. On the
other hand, A only accepts heavy duty INSERTs, so has only one
primary key index.
In other words, A is only an INSERT table. Periodically,
say every 20 minutes or so, I would like to take all the new INSERTs
from table A and put them into B.
Is there any clever command to accomplish this? I'd rather not write
a
php script with the sql to take every single new record, and insert it
one
by one into table B.
I currently use Postgres but am amenable to using any database if it
supports this well.
Thanks for any pointers!!
LB
--
Conan O' Brien gets it right!
http://blogs.pcworld.com/tipsandtweaks/archives/004369.html
.
- Follow-Ups:
- Re: Sync-ing two tables, one for INSERTS, another for SELECT
- From: Ed Prochak
- Re: Sync-ing two tables, one for INSERTS, another for SELECT
- From: Tonkuma
- Re: Sync-ing two tables, one for INSERTS, another for SELECT
- Prev by Date: Re: Flexible columns
- Next by Date: Re: Free database chart program
- Previous by thread: Free database chart program
- Next by thread: Re: Sync-ing two tables, one for INSERTS, another for SELECT
- Index(es):