QUERY PLAN
Aggregate (cost=2176.28..2176.29 rows=1 width=48)
-> Group (cost=2158.38..2160.49 rows=421 width=465)
Group Key: r.id
-> Sort (cost=2158.38..2159.44 rows=421 width=6)
Sort Key: r.id
-> Hash Right Join (cost=1970.23..2140.03 rows=421 width=6)
Hash Cond: (rccr.approve_id = r.id)
Filter: ((r.created_by = ANY ('{1000,1001,1004,1005,1011,1013,1015,1022,1023,5016,5064,5085,5087,5248,5250,5252,5295,5300,5311,5332,5360,5446,5461,5476,5499,5500}'::integer[])) OR (rccr.user_id = 1001) OR (rvr.user_id = 1001) OR (rcvr.user_id = 1001))
-> Seq Scan on tbl_approve_carbon_copy_rels rccr (cost=0.00..119.64 rows=7764 width=8)
-> Hash (cost=1968.39..1968.39 rows=147 width=18)
-> Hash Right Join (cost=1902.63..1968.39 rows=147 width=18)
Hash Cond: (rvr.approve_id = r.id)
-> Seq Scan on tbl_approve_verify_rels rvr (cost=0.00..53.03 rows=3003 width=8)
-> Hash (cost=1900.97..1900.97 rows=133 width=14)
-> Hash Left Join (cost=564.01..1900.97 rows=133 width=14)
Hash Cond: (r.id = rcvr.approve_id)
-> Hash Left Join (cost=562.97..1899.41 rows=133 width=10)
Hash Cond: (r.project_id = project.id)
Filter: ((r.title ~~* '%红%'::text) OR ((client.name)::text ~~* '%红%'::text) OR (client.pinyin_shortcut ~~* '%红%'::text) OR ((project.project_title)::text ~~* '%红%'::text) OR (r.description ~~* '%红%'::text) OR ((tt1.name)::text ~~* '%红%'::text))
-> Hash Left Join (cost=344.38..1673.73 rows=2692 width=351)
Hash Cond: (dt1.taxonomy_id = tt1.id)
-> Hash Left Join (cost=333.47..1655.65 rows=2692 width=343)
Hash Cond: (r.client_id = client.id)
-> Hash Right Join (cost=199.51..1514.62 rows=2692 width=292)
Hash Cond: (dt1.object_id = r.id)
-> Seq Scan on tbl_term_taxonomy_relationships dt1 (cost=0.00..1308.03 rows=2698 width=8)
Filter: (term_id = 17)
-> Hash (cost=165.86..165.86 rows=2692 width=288)
-> Seq Scan on tbl_approves r (cost=0.00..165.86 rows=2692 width=288)
Filter: (status <> 0)
-> Hash (cost=108.98..108.98 rows=1998 width=59)
-> Seq Scan on tbl_clients client (cost=0.00..108.98 rows=1998 width=59)
Filter: (NOT deleted)
-> Hash (cost=7.07..7.07 rows=307 width=16)
-> Seq Scan on tbl_term_taxonomies tt1 (cost=0.00..7.07 rows=307 width=16)
-> Hash (cost=178.82..178.82 rows=3182 width=26)
-> Seq Scan on tbl_projects project (cost=0.00..178.82 rows=3182 width=26)
-> Hash (cost=1.02..1.02 rows=2 width=8)
-> Seq Scan on tbl_approve_cancel_verify_rels rcvr (cost=0.00..1.02 rows=2 width=8)