Определение необходимого кол-ва памяти для sqlite

Модератор: Модераторы разделов

Аватара пользователя
KonishchevDmitry
Сообщения: 92
ОС: Ubuntu

Определение необходимого кол-ва памяти для sqlite

Сообщение KonishchevDmitry »

Замучился уже. Поиск не дает никаких результатов. Может, вы поможете...

Нужно определить, какой минимальный размер оперативной памяти я должен иметь, чтобы решать нужные мне задачи при помощи sqlite (памяти мало, файл подкачки создать не могу, т. к. операционная система не умеет это делать). Единственное, что удалось найти:
When you start a transaction in SQLite (which happens automatically before any write operation that is not within an explicit BEGIN...COMMIT) the engine has to allocate a bitmap of dirty pages in the disk file to help it manage its rollback journal. SQLite needs 256 bytes of RAM for every 1MB of database. For smaller databases, the amount of memory required is not a problem, but when database begin to grow into the multi-gigabyte range, the size of the bitmap can get quite large. If you need to store and modify more than a few dozen GB of data, you should consider using a different database engine.

PRAGMA cache_size = Number-of-pages;

Query or change the maximum number of database disk pages that SQLite will hold in memory at once. Each page uses about 1.5K of memory. The default cache size is 2000. If you are doing UPDATEs or DELETEs that change many rows of a database and you do not mind if SQLite uses more memory, you can increase the cache size for a possible speed improvement.

When you change the cache size using the cache_size pragma, the change only endures for the current session. The cache size reverts to the default value when the database is closed and reopened. Use the default_cache_size pragma to check the cache size permanently.
Но тут говорится только о памяти, необходимой для осуществления транзакции и о размере кэша. А мне хотелось бы знать, какой максимальный объем оперативной памяти может потребоваться вообще (при выборке, сортировке и т. п.).

Ткните, пожалуйста, ссылкой на информацию по этому поводу.
Спасибо сказали: