sqlite - 内存中的临时数据
我的情况:我有一个基于文件的 sqlite 数据库,并且希望在内存中完成所有临时内容(用于大型查询的临时数据库等)。我尝试使用 PRAGMA temp_store = 2 命令,但我不能 100% 确定它是否真的符合我的要求。奇怪的是,在调试时我仍然到达函数 winGetTempname ,它在磁盘上打开一个临时文件!
我想,一旦我设置了这个编译指示,它甚至不应该尝试打开临时文件...
我还尝试使用 TEMP_STORE 预处理器标志,但同样,对 winGetTempname 的调用是仍然完成......
有什么想法吗?
my situation: i have a file based sqlite db and want to have all temporary stuff done in memory (temp databases for large queries, etc). i tried using the PRAGMA temp_store = 2 command, but i am not 100% sure if it really does what i want. the strange thing is that while debugging i still reach the function winGetTempname which opens a temporary file on disk!
i thought, as soon as i have this pragma set, it should not even try to open a temporary file ...
i also tried to use the TEMP_STORE preprocessor flag, but again, the call to winGetTempname is still done ...
any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自文档
从上面可以清楚地看出,如果设置正确的标志,除了日志机制之外,所有临时操作都将在内存中执行。
如果您想确保使用实用程序来监视应用程序的文件系统活动,例如 Windows 上的进程监视器。
From the documentation
From the above is clear that if you set the proper flags, all the temporary actions will be performed in the memory except the journal mechanisms.
If you want to be sure use a utility to monitor your application for file system activity like Process Monitor on Windows.