switch over to multi for the "split" test

This commit is contained in:
John Krauss 2016-12-19 16:49:50 +00:00
parent 2398b0268f
commit 24587b7e03

View File

@ -126,13 +126,13 @@ def test_getgeometryscores_performance(geom_complexity, api_method, filters, tar
for rows in rownums: for rows in rownums:
stmt = '''SELECT {schema}{api_method}(geom, {filters}, {target_geoms}) stmt = '''SELECT {schema}{api_method}(geom, {filters}, {target_geoms})
FROM obs_perftest_{complexity} FROM obs_perftest_{complexity}
WHERE cartodb_id < {n}'''.format( WHERE cartodb_id <= {n}'''.format(
complexity=geom_complexity, complexity=geom_complexity,
schema='cdb_observatory.' if USE_SCHEMA else '', schema='cdb_observatory.' if USE_SCHEMA else '',
api_method=api_method, api_method=api_method,
filters=filters, filters=filters,
target_geoms=target_geoms, target_geoms=target_geoms,
n=rows+1) n=rows)
start = time() start = time()
query(stmt) query(stmt)
end = time() end = time()
@ -292,19 +292,17 @@ def test_getmeasure_split_performance(geom_complexity, normalization, geom, boun
rownums = (1, 5, 10, ) if geom_complexity == 'complex' else (5, 25, 50, ) rownums = (1, 5, 10, ) if geom_complexity == 'complex' else (5, 25, 50, )
for rows in rownums: for rows in rownums:
stmt = ''' stmt = '''
WITH meta AS (SELECT * FROM {schema}{api_method}meta( with data as (
(SELECT ST_SetSRID(ST_Extent(geom), 4326) SELECT * FROM {schema}{api_method}datamulti(
FROM obs_perftest_{complexity}), (SELECT array_agg((geom, cartodb_id)::geomval)
'us.census.acs.B01001002', {boundary})) FROM obs_perftest_{complexity}
, data AS (SELECT cartodb_id, {schema}{api_method}data( WHERE cartodb_id <= {n}),
{geom}, '{point_or_poly}', '{normalization}', numer_aggregate, (SELECT {schema}{api_method}metamulti(
numer_colname, numer_geomref_colname, numer_tablename, (SELECT st_setsrid(st_extent(geom),4326) from obs_perftest_{complexity}),
denom_colname, denom_geomref_colname, denom_tablename, json_build_array(json_build_object('numer_id', 'us.census.acs.B01001002'))
geom_colname, geom_geomref_colname, geom_tablename ))
) AS measure
FROM meta, obs_perftest_{complexity}
WHERE cartodb_id <= {n}
) )
AS x(cartodb_id INTEGER, measure Numeric))
UPDATE obs_perftest_{complexity} UPDATE obs_perftest_{complexity}
SET measure = data.measure SET measure = data.measure
FROM data FROM data