V
V
Vasily Pechersky2015-09-22 19:38:39
PHP
Vasily Pechersky, 2015-09-22 19:38:39

Efficient Algorithm for database synchronization on different engines?

There is data in dbase format (FoxPro in my case). It is necessary to synchronize information with a SQL (MySql, Postgres) server with a certain periodicity.
The synchronizer will be written in PHP.
Please tell me what is the fastest algorithm for performing this operation.
A simple and stupid loop for 85000 lines - seems to be inefficient and slow.
For one, how you can replace only the changed lines. Will it be more effective than replacing everything completely.
Thanks for the suggestions.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill, 2015-09-22
@kshvakov

mysql

truncate table;
LOAD DATA INFILE 'data.txt' INTO TABLE table;

postgres
truncate table;
COPY table FROM 'data.txt';

X
xmoonlight, 2015-09-22
@xmoonlight

It is better to bring all bases to the same form in Postgres.
There will be less work, and many times more benefits.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question