Replace extra sql by a simple annotate