PHP - SQLite 与 SQLite3 [英] PHP - SQLite vs SQLite3

查看:58
本文介绍了PHP - SQLite 与 SQLite3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 SQLite (2.8.17) 制作了一个 Web 应用程序,我现在才发现有一个 SQLite3.在制作 Web 应用程序时,它以某种方式引起了我的注意,可能是由于缺乏 php 函数的文档.

I've made a web application using SQLite (2.8.17), I've only now discovered that there's an SQLite3. It somehow eluded my attention when making the web application, probably due to the lack of documentation for the php functions.

我想知道,与 SQLite 相比,使用 SQLite3 有什么好处?是不是快了很多?

I'm wondering, what are the benefits of using SQLite3 over SQLite? Is it considerably faster?

推荐答案

SQLite2 在内部将每个值存储为字符串,而不管其类型如何.
升级到 SQLite3 肯定会缩小数据库大小,因为数字和 BLOBS 以它们的本机格式存储,这可以使事情运行得更快.
在我看来,另一个很大的优势是最近版本的 sqlite(从 3.6.23 开始)支持外键.

由于您使用的是 PHP,我建议您查看 PDO.如果您需要更改应用程序的 DBMS,它可能会很有帮助

SQLite2 internally stores every value as a string, regardless of its type.
Upgrading to SQLite3 will certainly shrink the database size since numbers and BLOBS get stored in their native formats, which could make things run faster.
Another big advantage in my opinion is that recent versions of sqlite, (starting from 3.6.23) support foreign keys.

Since you were using PHP, I would suggest that you look into PDO. It could prove helpful in case you need to change the DBMS for the application

这篇关于PHP - SQLite 与 SQLite3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆