lml/quadbase — pull request #130 by Dantemss (2012-06-11 22:37:13+00:00)
Title: Adds indices to most foreign keys and other fields we search on

Should make most of the site faster (I hope)

To find duplicate project_questions (same project, same question) try this:

ProjectQuestion.select{`*`}.select{id.as(pq_id)}.select{project_id.as(p_id)}.select{question_id.as(q_id)}.where{exists(ProjectQuestion.where{(id != `pq_id`) & (question_id == `q_id`) & (project_id == `p_id`)})}