【发布时间】:2015-07-19 00:09:56
【问题描述】:
result = db((db.company.location.belongs(locations)) &
(db.company.emp_id.belongs(employee_ids)) &
(db.company.type.belongs(types))).select()
locations 是位置 ID 列表
employee_ids 是员工 ID 列表
types = ['General', 'office', 'e-commerce']
此查询返回 60,000 条记录,需要 1 分钟才能完成。如何优化或拆分?
【问题讨论】:
标签: python mysql web2py database-abstraction