A
A
Artem2014-11-05 13:44:53
MySQL
Artem, 2014-11-05 13:44:53

How to concatenate a large number of rows by summing data across identical rows?

Hello!
Initial data:
50 csv-files in the format
документ;колонка1;колонка2;колонка3
There are about a billion lines in all files.
Documents can be repeated both within one file and between several files (the number of identical documents is not known in advance).
Necessary:
​​Combine all files into one (or into one database), summing up the data in column1, column2 and column3 for identical documents.
Can you please tell me how it can be done in the shortest time?
I put SQL tags, because I think that one cannot do without some kind of SQL server.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2014-11-05
@devspec

Perhaps it is worth starting a conversation with a programming language?)

@
@mgyk, 2014-11-05
_

It will be faster to do LOAD DATA INFILE dev.mysql.com/doc/refman/5.1/en/load-data.html and import directly from CSV.
You can try engine=ARCHIVE if the operation is a one-time operation. There will be a greater chance of getting into memory with the next GROUP BY

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question