discourse/discourse — pull request #2782 by riking (2014-09-11 02:59:44+00:00)
Title: PERF: Tame eager-loading of category definition topic URL

With this change, the EXPLAIN on the topic query is reduced in cost, and
script/bench.rb results are improved.

Explain topic query, cost at root level:

cost=641.84..641.92 --> cost=570.03..570.11

script/bench.rb result, 50th percentile:

BEFORE
---
```
categories_admin: 95
home_admin: 80
topic_admin: 33
categories: 71
home: 51
topic: 15
```

AFTER
---
```
categories_admin: 78
home_admin: 58
topic_admin: 49
categories: 40
home: 34
topic: 30
```