Fast flush database to memory in file

I want to take advantage of the speed of storing an SQLite database (via SQLAlchemy) in memory when I look at the one-time process for inserting content and then upload it to a file that will be used later.

Consider the standard bog-standard database created in the usual way :

# in-memory database
e = create_engine('sqlite://')

Is there a quick way to move its contents to disk besides creating just a new database and inserting each record manually?

EDIT:

There are some doubts as to whether I really see any benefits of using the database in memory. Unfortunately, I already see a huge time difference of about 120 times.

This confusion is probably due to the fact that I missed some important details in the question. Perhaps due to a lack of understanding on my part re: caches / page sizes / etc. Let me clarify:

I run a simulation of the system that I installed, with each simulation going through the following steps:

  • Make some database queries.
  • Make calculations / run a simulation based on the results of these queries.
  • insert new database entries based on the latest simulation.
  • Make sure the database is updated with new entries by running commit().

, , . , ; 6 .

, . python script, , .

+5
1

SQLAlchemy SQLite .

SQLite , , , , . 1,5 , . SQLite Performance Benchmark - : : ... 1,5 , ?

, .

+1

All Articles