QUERY PLAN
Limit (cost=173.02..173.03 rows=1 width=156)
-> Sort (cost=173.02..173.03 rows=1 width=156)
Sort Key: p.updated_at DESC
-> Hash Left Join (cost=77.83..173.01 rows=1 width=156)
Hash Cond: (p.product_serie = ps.id)
Filter: ((lower((p.name)::text) ~~* '%mk-mc300%'::text) OR (p.pinyin_shortcut ~~* '%mk-mc300%'::text) OR (lower((pt.name)::text) ~~* '%mk-mc300%'::text) OR (lower((pb.name)::text) ~~* '%mk-mc300%'::text) OR (lower((ps.name)::text) ~~* '%mk-mc300%'::text) OR (lower((pc.name)::text) ~~* '%mk-mc300%'::text) OR (lower(p.description) ~~* '%mk-mc300%'::text))
-> Hash Left Join (cost=15.92..105.49 rows=2122 width=192)
Hash Cond: (p.product_component = pc.id)
-> Hash Left Join (cost=10.32..94.17 rows=2122 width=176)
Hash Cond: (p.product_type = pt.id)
-> Hash Left Join (cost=7.90..85.81 rows=2122 width=164)
Hash Cond: (p.product_brand = pb.id)
-> Seq Scan on tbl_products p (cost=0.00..72.22 rows=2122 width=156)
-> Hash (cost=5.18..5.18 rows=218 width=12)
-> Seq Scan on tbl_product_brands pb (cost=0.00..5.18 rows=218 width=12)
-> Hash (cost=1.63..1.63 rows=63 width=16)
-> Seq Scan on tbl_product_types pt (cost=0.00..1.63 rows=63 width=16)
-> Hash (cost=3.60..3.60 rows=160 width=20)
-> Seq Scan on tbl_product_components pc (cost=0.00..3.60 rows=160 width=20)
-> Hash (cost=41.96..41.96 rows=1596 width=33)
-> Seq Scan on tbl_product_series ps (cost=0.00..41.96 rows=1596 width=33)