I think using this will be better for the heat : select bug.heat from bug, bugtask where bugtask.bug = bug.id and bugtask.distribution = 1 order by bug.heat desc limit 1; heat ------- 11062 (1 row) Time: 58.710 ms
I think using this will be better for the heat : distribution = 1 order by bug.heat desc limit 1;
select bug.heat from bug, bugtask where bugtask.bug = bug.id and bugtask.
heat
-------
11062
(1 row)
Time: 58.710 ms