QUERY PLAN Limit (cost=6306.07..6306.22 rows=60 width=218) (actual time=19714.478..19715.038 rows=60 loops=1) -> Sort (cost=6306.07..6308.76 rows=1076 width=218) (actual time=19714.468..19714.654 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=19423.173..19588.618 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=36.540..85.086 rows=2474 loops=1) -> Sort (cost=6127.14..6129.83 rows=1075 width=205) (actual time=19365.446..19396.592 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=111.283..19307.516 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=56.188..6877.200 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=1.218..1.222 rows=1 loops=10027) Index Cond: (sucursales_136.suc_id_n = "outer".cxs_suc_fk_n) Total runtime: 19720.354 ms