且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

速度:MySQL与文件输出

更新时间:2023-02-10 15:52:23

It depends on your need for the data at the end of the day. Do you need to be able to do Audits on the data outside of scrolling through a file. If you don't need to browse the data or store it in perpetuity, then a flat file will be faster than MySQL, most likely, if you are just appending to the end of a file.

If you need the data to be more useful, you'll want to store it in mysql. I would suggest that you structure your table like:

id  int
timestamp datetime default now()
desc varchar

That way you don't have to actually create a timestamp in PHP and just let mysql do the work, then you'll e able to do more complex queries off of your table. But, another consideration you'll want to think about is the volume of the data going into this table, as that will also affect your final decision.

相关阅读

技术问答最新文章