Sqlite 和其他嵌入式数据库的内存表功能
我正在寻找一种功能,可以在内存表中保留一些数据以供频繁使用,而在普通表(磁盘上)中保留不太频繁的数据。 这可以在 sqlite 中使用 Attach 命令来实现,但问题是,如果我必须一起查询两个表(内存表和普通表),我必须进行联合。 这是一个解决方法(我想避免联合),但我想知道 sqlite 是否有任何内置机制用于此目的? 另外,很高兴知道 sqlite 是否是嵌入式世界中此类工作的最佳候选者?或者是否有任何商业嵌入式数据库可以在这种情况下很好地工作。 期待答案。
期待中感谢您 纳迪姆
I am looking for a functionality in which i can keep some data in the memory tables for frequent usage and the less frequent data in normal tables (on disk).
This can be achieved in sqlite using the attach command, but problem is that if i have to query the two tables (in memory table and normal table) together, i have to do a union.
This is a work around (i want to avoid union) but i want to know if sqlite has any built in mechanism for this purpose?
Also, it would be great to know if sqlite is the best candidate for such kind of work in the embedded world?? Or are there any commercial embedded databases available that can work well in such cases.
Looking forward for the answers.
Thanking you in anticipation
Nadeem
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建临时视图以及临时表和非临时表:
然后您可以同时从两个表中进行选择:
You can create a temporary view along with the temporary and non-temporary table:
Then you can select from both tables at once: