简体   繁体   中英

sqlite3 :memory: db in multiple python scripts and sqlite3 performance

I am using sqlite3 :memory: db in multiple python scripts connecting by apsw .
The question is, whether multiple programs running :memory: db affect one another, or sqlite3 performance?

According to sqlite's own documentation ( here ), each database created with :memory: is distinct from another. So if you create two databases using :memory: they are both different from one another.

Regarding :memory: performance issues, you may find good information here: SQLite Performance Benchmark -- why is :memory: so slow...only 1.5X as fast as disk?

There is always a performance hit when you run more than one program at once, so there will certainly be some impact on performance. The magnitude depends on what you're doing. Running several complex SQL queries at the same time might result in a noticeable drain on system resources, but if all you have little enough data that it all fits in memory then it can probably handle any query you give it.

Multiple connections to :memory: don't share memory, so multiple instances of python and sqlite won't affect each other by changing data, if that's what you're asking

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM