Return size information for a database, based on the page size and number of pages
#include <qdb/qdb.h> int qdb_getdbsize( qdb_hdt_t *db, int scope, uint32_t *page_size, uint32_t *total_pages, uint32_t *free_pages );
This function provides information about the size of the database associated with the db handle. The information reported includes the page size (in bytes) and total number of pages in the database file. In the filesystem, the database's size is page_size × total_pages. The function also reports the number of free pages, which are pages that don't currently store any data.
If you vacuum the database, QDB deletes the free pages so the total page count decreases, the free page count goes to 0, and the database file becomes smaller. For more information, see the VACUUM SQL command, the qdb_vacuum() function, and the Auto-vacuum section of the PRAGMA command.
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |