摘要
网站设计中数据库查询是非常关键的技术,好的查询方法可以大大地节省开销。数据库越庞大,要求查询效率越高。文章以Django开发为背景,对ORM模型数据查询做了一些验证性研究。阐述了数据库中相关联表(如:一对多关系与多对多关系等)数据查询的优化方法,编写了视图函数和URL映射进行测试,并对结果数据做了比较与分析。贯穿全文,是一个完整的Django数据查询项目。
Data query is an essential utility in website design. A well-constructed data query method can lead to significant cost reductions. The requirement for data query efficiency also grows with the size of the database. This article conducted a series of confirmatory research on ORM model data query using Django. It also described the optimization of data query for associated table within a database(i.e. Many-to-one relationship, Many-to-many relationship, etc.). The author used Django view and URL mapping for testing,compared and analyzed the output. In summary, this illustrates a complete Django data query project.
引文
[1]罗广恒.基于Django和MySQL的网络化测试数据查询系统研究[J].智能物联技术, 2019, 51(2):15.
[2]韩兵,李晶晶.基于JDBC数据管理与查询优化的研究[J].计算机技术与发展, 2018, 28(9):176-180.
[3]郭威.关系数据查询优化策略研究[J].软件导刊, 2013, 12(8):111-113.