2 384
edições
m (→Novo processo) |
m (→Novo processo: revisando algoritmo para big text) |
||
Linha 69: | Linha 69: | ||
drop FUNCTION osmc.grid_generate_all_levels_logistic; | drop FUNCTION osmc.grid_generate_all_levels_logistic; | ||
CREATE or replace FUNCTION osmc.grid_generate_all_levels_logistic( | CREATE or replace FUNCTION osmc.grid_generate_all_levels_logistic( | ||
p_lev_max numeric, p_contry text, | |||
p_contry_cover text, | p_contry_cover text[], | ||
p_contry_base integer, | p_contry_base integer, | ||
p_lev0 numeric default 2.5 | p_lev0 numeric default 2.5 | ||
Linha 90: | Linha 90: | ||
) t | ) t | ||
$$; | $$; | ||
UNNEST ORD | |||
GROUP BY ORD%1000 FAZ O FRAG | |||
p_contry_cover quebrada em pedacos cover_frag de 1000 items | |||
FOR lev IN (select x from generate_series(p_lev0, p_lev_max, 2.5) t(x)) LOOP | FOR lev IN (select x from generate_series(p_lev0, p_lev_max, 2.5) t(x)) LOOP | ||
IF lev>p_lev0 THEN s := s || E'\n UNION ALL \n'; END IF; | IF lev>p_lev0 THEN s := s || E'\n UNION ALL \n'; END IF; | ||
s := s || format(tpl, lev::text, p_contry, | s := s || format(tpl, lev::text, p_contry, cover_frag, p_contry_base::text); | ||
END LOOP; | END LOOP; | ||
s := s|| E'\n ORDER BY 1'; | s := s|| E'\n ORDER BY 1'; |
edições