SQL=select accessories.*, vfa.fields_arr, cp.price as cprice from only accessories left join vw_fields_arr as vfa on (vfa.pid = accessories.guid) left join custom_prices as cp on (cp.offer = accessories.guid) and (cp.client_extid::text = (select ext_id from users where id = 0) ) inner join catalog_related_products as crp on crp._parent = '' and accessories.guid = crp.child order by crp.ord, accessories.name limit 30