QUERY PLAN
Aggregate (cost=231.61..231.62 rows=1 width=8)
-> Sort (cost=203.32..208.03 rows=1886 width=665)
Sort Key: p.updated_at DESC, p.id DESC
-> HashAggregate (cost=81.85..100.71 rows=1886 width=665)
Group Key: p.id
-> Hash Left Join (cost=1.09..77.14 rows=1886 width=12)
Hash Cond: (p.id = eip.product_id)
-> Seq Scan on tbl_products p (cost=0.00..61.86 rows=1886 width=28)
-> Hash (cost=1.04..1.04 rows=4 width=4)
-> Seq Scan on tbl_erp_inventory_products eip (cost=0.00..1.04 rows=4 width=4)