PHP - SQLite vs SQLite3

余生颓废 提交于 2019-12-03 16:27:30

问题


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.

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


回答1:


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




回答2:


This documents from the sqlite.org website: http://www.sqlite.org/version3.html it doesn't talk about performance, but differences. anyway there are not update to sqlite2 I personally recommend using latest and greatest version 3 (see Improved Concurrency, always good for web applications).



来源:https://stackoverflow.com/questions/4373562/php-sqlite-vs-sqlite3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!