亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Is there any good way to use PHP to process a very large SQLite file (tens of gigabytes)?
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-05-16 13:04:33
0
9
777

What’s a good way to use PHP to process a very large SQLite file (tens of gigabytes)?
It just died when processing it~~

PHP中文網(wǎng)
PHP中文網(wǎng)

認證高級PHP講師

reply all(9)
左手右手慢動作

Such a large file cannot be processed by PHP. To process a file, PHP must first read it into memory, and the memory that each script can use is related to the memory_limit in the PHP configuration file. As long as your memory is large enough, you can set it to unlimited and use the maximum memory of the system.

The recommended solution is to first cut the file into small files, use a shell program such as sed to cut the file into several small files according to a certain size (the size is determined according to your PHP memory size), and then process it with PHP.

世界只因有你

Read line by line, PHP has this function, it reads 3 lines at a time, but SQLite is a local database, and reading is a matter of the driver. It has nothing to do with PHP. Just don’t print it all at once

阿神

The data should be transferred to MYSQL and then provided to PHP for reading and writing. SQLite is originally a small file database with low ability to handle huge data.

大家講道理

Shocked! For such a large amount of data, sqlite is still used.
Besides, if you read dozens of gigabytes into the memory at one time, unless your memory really has dozens of gigabytes, it will definitely burst the memory.
It is recommended to try to split this database or convert it to other types of database processing.

過去多啦不再A夢

PHP’s text processing is not ideal and very slow. The solution of processing after entering mysql is feasible, but it is more time-consuming.

Reference Use it to check

世界只因有你

I don’t understand sqlite, but it must be difficult to process such a large file directly. But there is a general idea. Just dismantling. According to the library. Watch or something.

小葫蘆

Since it is a sqlite file, just click Database Read->Process->Storage. PHP can use sqlite directly by default.

曾經(jīng)蠟筆沒有小新

Convert sqlite to Mysql, then optimize the index, and there should be no problem.

給我你的懷抱

Please refer to this product

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template