QUERY PLAN Limit (cost=6306.07..6306.22 rows=60 width=218) (actual time=980.996..981.597 rows=60 loops=1) -> Sort (cost=6306.07..6308.76 rows=1076 width=218) (actual time=980.983..981.180 rows=60 loops=1) Sort Key: sucursales_136.suc_norm_name_s -> Merge Join (cost=6127.14..6251.89 rows=1076 width=218) (actual time=599.741..817.989 rows=10027 loops=1) Merge Cond: ("outer".loc_id_n = "inner".suc_loc_fk_n) -> Index Scan using location_pkey on "location" (cost=0.00..4716.07 rows=144354 width=17) (actual time=0.016..15.329 rows=2474 loops=1) -> Sort (cost=6127.14..6129.83 rows=1075 width=205) (actual time=592.357..643.639 rows=10027 loops=1) Sort Key: sucursales_136.suc_loc_fk_n -> Nested Loop (cost=0.00..6073.02 rows=1075 width=205) (actual time=0.058..507.954 rows=10027 loops=1) -> Index Scan using cxs_cat_136_index on zcatxsuc_136 (cost=0.00..1864.42 rows=1075 width=4) (actual time=0.019..71.631 rows=10027 loops=1) Index Cond: (cxs_cat_fk_n = 809) -> Index Scan using sucursales_136_pkey on sucursales_136 (cost=0.00..3.90 rows=1 width=205) (actual time=0.013..0.019 rows=1 loops=10027) Index Cond: (sucursales_136.suc_id_n = "outer".cxs_suc_fk_n) Total runtime: 986.670 ms (14 rows)