Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Merging Tables with renumbering primary key

From: D$ <mysql(at)godseyfamily.com>
Date: Thu Sep 27 2007 - 15:57:33 EDT

I have a set up where data will be collected on several local machines, and then needs to be merged into a single database on a data storage server. I have two tables that have auto_incrementing ids that I don't want to clash when merging, and another table that uses one of these autoincrementing numbers as a key that would need to be changed when transfered to the storage server.

The tables look like: d

data__ProcessedDataFrames
data__RawDataFrames
data__Raw_in_Processed (this has a key into data__ProcessedDataFrames on
the auto_incremented id)

mysql> desc data__ProcessedDataFrames;

+------------------------+------------------+------+-----+---------+----------------+

| Field | Type | Null | Key | Default | Extra
| +------------------------+------------------+------+-----+---------+----------------+
| processed_id | int(10) unsigned | NO | PRI | NULL |
auto_increment |
| top_level_product_name | varchar(255) | YES | MUL | NULL |
|
| test_id | int(10) unsigned | YES | MUL | NULL |
|
| payload_time | double | YES | MUL | NULL |
|
| universal_time | double | YES | | NULL |
|
| processed_data | mediumblob | YES | | NULL |
| +------------------------+------------------+------+-----+---------+----------------+
6 rows in set (0.01 sec)

mysql> desc data__RawDataFrames;

+--------------+------------------+------+-----+---------+----------------+

| Field | Type | Null | Key | Default | Extra |
+--------------+------------------+------+-----+---------+----------------+
| raw_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| test_id | int(10) unsigned | NO | PRI | 0 | |
| payload_time | double | YES | MUL | NULL | |
| raw_data | blob | YES | | NULL | |
| frame_name | varchar(100) | YES | MUL | NULL | |
+--------------+------------------+------+-----+---------+----------------+
5 rows in set (0.02 sec)

mysql> desc data__Raw_in_Processed;

+--------------+------------------+------+-----+---------+-------+

| Field | Type | Null | Key | Default | Extra |
+--------------+------------------+------+-----+---------+-------+
| processed_id | int(10) unsigned | NO | MUL | | |
| frame_name | varchar(100) | YES | | NULL | |
| payload_time | double | YES | | NULL | |
+--------------+------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql>

Again each individual box will be collecting data separately, and when we decide to store the data we need to merge it onto a storage server into the same database.

Do you need help?X

Are there some docs out that that could be helpful or any tips from anyone?

D$

-- 
MySQL General Mailing List
For list archives: 
http://lists.mysql.com/mysql
To unsubscribe:    
http://lists.mysql.com/mysql?unsub=lists@pantek.com
Received on Thu Sep 27 15:58:51 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:12:28 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library