QUERY PLAN
Sort (cost=224.11..224.12 rows=1 width=467)
Sort Key: r.created_at DESC
-> Nested Loop Left Join (cost=0.29..224.10 rows=1 width=467)
Filter: (dt1.taxonomy_id IS NULL)
-> Seq Scan on tbl_approves r (cost=0.00..165.86 rows=7 width=467)
Filter: (created_by = 1001)
-> Index Scan using tbl_term_taxonomy_relationships_object_id_term_id_idx on tbl_term_taxonomy_relationships dt1 (cost=0.29..8.31 rows=1 width=8)
Index Cond: ((object_id = r.id) AND (term_id = 17))