M
M
Michael2018-02-21 07:53:12
Database
Michael, 2018-02-21 07:53:12

How to correctly add data to the database?

Good day to all!
The database has a reference table (let's say id + object description) of 20k lines, which needs to be updated daily (adding up to 10 records) based on a new xml file.
Is it correct to upload a new file to a temporary table and add new records to the main one when updating?
Or is it better when uploading a file (using python, for example) to immediately detect new records and add them to the main one?
DB Access, Oracle, MySQL

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DDDsa, 2018-02-21
@Araben

And how will you define new records using python? Are they marked in the file somehow? Or will you make a select from the database for each entry to check whether it is there or not?
If they are marked, then it is easier in python to select only new ones and load them into the database. If unchecked, then twenty thousand validation selects will work much slower than one large insert into a temporary table and then comparison using the database itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question