Limit (cost=749.97..749.97 rows=2 width=133) |
-> Sort (cost=749.97..749.97 rows=2 width=133) |
Sort Key: c.signed_at DESC, c.created_at DESC |
-> Group (cost=749.95..749.96 rows=2 width=133) |
Group Key: c.id |
-> Sort (cost=749.95..749.95 rows=2 width=133) |
Sort Key: c.id |
-> Nested Loop Left Join (cost=105.99..749.94 rows=2 width=133) |
Join Filter: (sgr.sales_id = client.sales_rep) |
-> Nested Loop Left Join (cost=105.99..746.86 rows=2 width=137) |
-> Nested Loop (cost=105.71..745.87 rows=2 width=137) |
-> Index Only Scan using tbl_suppliers_pkey on tbl_suppliers supplier (cost=0.28..8.29 rows=1 width=4) |
Index Cond: (id = 718) |
-> Hash Right Join (cost=105.43..737.56 rows=2 width=137) |
Hash Cond: (cs.object_id = c.id) |
-> Seq Scan on tbl_attachement_relationships cs (cost=0.00..624.51 rows=2027 width=4) |
Filter: (object_type = 108) |
-> Hash (cost=105.41..105.41 rows=2 width=137) |
-> Hash Right Join (cost=70.22..105.41 rows=2 width=137) |
Hash Cond: (pcr.contract_id = c.id) |
-> Seq Scan on tbl_purchase_client_rels pcr (cost=0.00..30.15 rows=1915 width=8) |
-> Hash (cost=70.19..70.19 rows=2 width=133) |
-> Seq Scan on tbl_purchase_contracts c (cost=0.00..70.19 rows=2 width=133) |
Filter: ((cost_type = ANY ('{1,2}'::integer[])) AND (supplier_id = 718)) |
-> Index Scan using tbl_clients_pkey on tbl_clients client (cost=0.28..0.49 rows=1 width=8) |
Index Cond: (pcr.client_id = id) |
-> Materialize (cost=0.00..1.73 rows=49 width=4) |
-> Seq Scan on tbl_sales_group_relationships sgr (cost=0.00..1.49 rows=49 width=4) |