HashAggregate (cost=2141.19..2172.33 rows=1557 width=24) |
Group Key: c.id, c.client_class, c.created_at, (date_part('epoch'::text, (CURRENT_TIMESTAMP - max(sl.end_at))) / '86400'::double precision) |
-> HashAggregate (cost=2094.48..2125.62 rows=1557 width=24) |
Group Key: c.id |
-> Hash Right Join (cost=202.60..1954.89 rows=27918 width=24) |
Hash Cond: (sl.client_id = c.id) |
-> Seq Scan on tbl_work_logs sl (cost=0.00..1661.24 rows=34624 width=12) |
-> Hash (cost=183.14..183.14 rows=1557 width=16) |
-> Seq Scan on tbl_clients c (cost=0.00..183.14 rows=1557 width=16) |
Filter: ((NOT deleted) AND (sales_rep = 1001)) |