运行时的mysql视图与运行时创建表:性能和其他问题

时间:2014-12-23 20:12:33

标签: php mysql performance

我正在开发一个GPS应用程序,每隔2分钟就会有5000多台设备向服务器发送数据。

该系统正在cakephp 2.0和Mysql

中开发

记住应用程序的速度,我想在公司注册期间在运行时创建3个表,如

companyid_today - stores the records for all devices of the company for today
companyid_yesterday - stores all the records for all devoices of the company for yesterday 
companyid_history - stores all the records - for history search.

我在当天结束时通过crons清除今天和昨天的表格,并将今天的数据复制到昨天。

这样做可以使地图上的渲染速度更快,因为在非常大的表格上进行查询并且在地图上渲染需要花费大量时间

我还有其他选择,例如

在公司注册期间根据公司ID在运行时创建视图,但需要知道对mysql 5.5.31的视图支持以及是否可以根据当前日期的逻辑创建视图。

需要关于保持应用程序速度和大量数据处理的最佳方法的建议

0 个答案:

没有答案