result = db((db.company.location.belongs(locations)) &
(db.company.emp_id.belongs(employee_ids)) &
(db.company.type.belongs(types))).select()
locations
is list of location ids
employee_ids
is list of employee ids
types = ['General', 'office', 'e-commerce']
This query return 60,000 records and takes 1 minute to complete. How can I optimize it or split it?