Skip to content

Commit

Permalink
Reduce execution time of tests for spatial functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Esteban Zimanyi committed Dec 5, 2019
1 parent 64b0c0a commit 2d394e2
Show file tree
Hide file tree
Showing 14 changed files with 150 additions and 94 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Expand Up @@ -21,7 +21,7 @@ src/temporal_boolops.c
src/temporal_boxops.c
src/temporal_compops.c
src/temporal_gist.c
src/temporal_mathfuncs.c
src/tnumber_mathfuncs.c
src/temporal_parser.c
src/temporal_posops.c
src/temporal_selfuncs.c
Expand Down Expand Up @@ -52,10 +52,10 @@ src/sql/15_time_spgist.in.sql
src/sql/20_doublen.in.sql
src/sql/21_tbox.in.sql
src/sql/22_temporal.in.sql
src/sql/24_temporal_mathfuncs.in.sql
src/sql/24_tnumber_mathfuncs.in.sql
src/sql/26_temporal_boolops.in.sql
src/sql/28_temporal_textfuncs.in.sql
src/sql/30_temporal_compops.in.sql
src/sql/27_temporal_textfuncs.in.sql
src/sql/28_temporal_compops.in.sql
src/sql/32_temporal_boxops.in.sql
src/sql/34_temporal_posops.in.sql
src/sql/36_temporal_aggfuncs.in.sql
Expand Down
2 changes: 1 addition & 1 deletion doc/mobilitydb-manual.xml
Expand Up @@ -2912,7 +2912,7 @@ SELECT ttext '[A@2012-01-01, B@2012-01-03, C@2012-01-04]' ||

<listitem>
<para>Transform to uppercase</para>
<para><varname>upper(ttext, integer): ttext</varname></para>
<para><varname>upper(ttext): ttext</varname></para>
<programlisting>
SELECT upper(ttext '[AA@2000-01-01, bb@2000-01-02]');
-- "["AA"@2000-01-01, "BB"@2000-01-02]"
Expand Down
@@ -1,6 +1,6 @@
/*****************************************************************************
*
* temporal_mathfuncs.c
* tnumber_mathfuncs.c
* Temporal mathematical operators (+, -, *, /) and functions (round,
* degrees).
*
Expand Down
2 changes: 1 addition & 1 deletion point/src/tpoint_spatialfuncs.c
Expand Up @@ -23,7 +23,7 @@
#include "oidcache.h"
#include "temporal_util.h"
#include "lifting.h"
#include "temporal_mathfuncs.h"
#include "tnumber_mathfuncs.h"
#include "tpoint.h"
#include "tpoint_boxops.h"
#include "tpoint_distance.h"
Expand Down
140 changes: 84 additions & 56 deletions point/test/expected/56_tpoint_spatialfuncs_tbl.test.out
Expand Up @@ -506,18 +506,20 @@ WHERE minusGeometry(temp, g) IS NOT NULL AND minusGeometry(temp, g) != temp LIMI
{0101000000000070FD137F28400000262BD61F5840@2001-03-31 21:42:00+00, 01010000000000F81DEDB3514000002825110F5040@2001-03-31 21:47:00+00, 01010000000000546B525B5540000090E820325640@2001-03-31 21:50:00+00, 0101000000000020006D6512400000D49C987B5640@2001-03-31 21:55:00+00, 0101000000000052925CA054400000DA9BF3E75740@2001-03-31 22:00:00+00, 01010000000000901F7EBF32400000DED412F35440@2001-03-31 22:03:00+00}
(10 rows)

SELECT count(*) FROM tbl_tgeompoint, tbl_geometry
SELECT count(*) FROM tbl_tgeompoint,
( SELECT * FROM tbl_geometry LIMIT 10 ) t
WHERE NearestApproachInstant(temp, g) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeompoint t1, tbl_tgeompoint t2
SELECT count(*) FROM tbl_tgeompoint t1,
( SELECT * FROM tbl_tgeompoint t2 LIMIT 10 ) t2
WHERE NearestApproachInstant(t1.temp, t2.temp) IS NOT NULL;
count
-------
125
18
(1 row)

/* Errors */
Expand All @@ -531,18 +533,20 @@ WHERE NearestApproachInstant(t1.temp, t2.temp) IS NOT NULL;
121
(1 row)

SELECT count(*) FROM tbl_tgeogpoint, tbl_geography
SELECT count(*) FROM tbl_tgeogpoint,
( SELECT * FROM tbl_geography LIMIT 10 ) t
WHERE NearestApproachInstant(temp, g) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeogpoint t1, tbl_tgeogpoint t2
SELECT count(*) FROM tbl_tgeogpoint t1,
( SELECT * FROM tbl_tgeogpoint t2 LIMIT 10 ) t2
WHERE NearestApproachInstant(t1.temp, t2.temp) IS NOT NULL;
count
-------
129
18
(1 row)

/* Errors */
Expand All @@ -556,172 +560,196 @@ WHERE NearestApproachInstant(t1.temp, t2.temp) IS NOT NULL;
130
(1 row)

SELECT count(*) FROM tbl_tgeompoint, tbl_geometry
SELECT count(*) FROM tbl_tgeompoint,
( SELECT * FROM tbl_geometry LIMIT 10 ) t
WHERE NearestApproachDistance(temp, g) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeompoint t1, tbl_tgeompoint t2
SELECT count(*) FROM tbl_tgeompoint t1,
( SELECT * FROM tbl_tgeompoint t2 LIMIT 10 ) t2
WHERE NearestApproachDistance(t1.temp, t2.temp) IS NOT NULL;
count
-------
152
18
(1 row)

SELECT count(*) FROM tbl_tgeompoint3D, tbl_geometry3D
SELECT count(*) FROM tbl_tgeompoint3D,
( SELECT * FROM tbl_geometry3D LIMIT 10 ) t
WHERE NearestApproachDistance(temp, g) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeompoint3D t1, tbl_tgeompoint3D t2
SELECT count(*) FROM tbl_tgeompoint3D t1,
( SELECT * FROM tbl_tgeompoint3D LIMIT 10 ) t2
WHERE NearestApproachDistance(t1.temp, t2.temp) IS NOT NULL;
count
-------
150
18
(1 row)

SELECT count(*) FROM tbl_tgeogpoint, tbl_geography
SELECT count(*) FROM tbl_tgeogpoint,
( SELECT * FROM tbl_geography LIMIT 10 ) t
WHERE NearestApproachDistance(temp, g) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeogpoint t1, tbl_tgeogpoint t2
SELECT count(*) FROM tbl_tgeogpoint t1,
( SELECT * FROM tbl_tgeogpoint t2 LIMIT 10 ) t2
WHERE NearestApproachDistance(t1.temp, t2.temp) IS NOT NULL;
count
-------
148
18
(1 row)

SELECT count(*) FROM tbl_tgeogpoint3D, tbl_geography3D
SELECT count(*) FROM tbl_tgeogpoint3D,
( SELECT * FROM tbl_geography3D LIMIT 10 ) t
WHERE NearestApproachDistance(temp, g) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeogpoint3D t1, tbl_tgeogpoint3D t2
SELECT count(*) FROM tbl_tgeogpoint3D t1,
( SELECT * FROM tbl_tgeogpoint3D LIMIT 10 ) t2
WHERE NearestApproachDistance(t1.temp, t2.temp) IS NOT NULL;
count
-------
150
18
(1 row)

SELECT count(*) FROM tbl_tgeompoint, tbl_geometry
SELECT count(*) FROM tbl_tgeompoint,
( SELECT * FROM tbl_geometry LIMIT 10 ) t
WHERE g |=| temp IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeompoint t1, tbl_tgeompoint t2
SELECT count(*) FROM tbl_tgeompoint t1,
( SELECT * FROM tbl_tgeompoint t2 LIMIT 10 ) t2
WHERE t1.temp |=| t2.temp IS NOT NULL;
count
-------
152
18
(1 row)

SELECT count(*) FROM tbl_tgeompoint3D, tbl_geometry3D
SELECT count(*) FROM tbl_tgeompoint3D,
( SELECT * FROM tbl_geometry3D LIMIT 10 ) t
WHERE g |=| temp IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeompoint3D t1, tbl_tgeompoint3D t2
SELECT count(*) FROM tbl_tgeompoint3D t1,
(SELECT * FROM tbl_tgeompoint3D LIMIT 10 ) t2
WHERE t1.temp |=| t2.temp IS NOT NULL;
count
-------
150
18
(1 row)

SELECT count(*) FROM tbl_tgeogpoint, tbl_geography
SELECT count(*) FROM tbl_tgeogpoint,
( SELECT * FROM tbl_geography LIMIT 10 ) t
WHERE g |=| temp IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeogpoint t1, tbl_tgeogpoint t2
SELECT count(*) FROM tbl_tgeogpoint t1,
( SELECT * FROM tbl_tgeogpoint t2 LIMIT 10 ) t2
WHERE t1.temp |=| t2.temp IS NOT NULL;
count
-------
148
18
(1 row)

SELECT count(*) FROM tbl_tgeogpoint3D, tbl_geography3D
SELECT count(*) FROM tbl_tgeogpoint3D,
( SELECT * FROM tbl_geography3D LIMIT 10 ) t
WHERE g |=| temp IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeogpoint3D t1, tbl_tgeogpoint3D t2
SELECT count(*) FROM tbl_tgeogpoint3D t1,
(SELECT * FROM tbl_tgeogpoint3D LIMIT 10 ) t2
WHERE t1.temp |=| t2.temp IS NOT NULL;
count
-------
150
18
(1 row)

SELECT count(*) FROM tbl_tgeompoint, tbl_geometry
SELECT count(*) FROM tbl_tgeompoint,
( SELECT * FROM tbl_geometry LIMIT 10 ) t
WHERE shortestLine(g, temp) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeompoint t1, tbl_tgeompoint t2
SELECT count(*) FROM tbl_tgeompoint t1,
( SELECT * FROM tbl_tgeompoint t2 LIMIT 10 ) t2
WHERE shortestLine(t1.temp, t2.temp) IS NOT NULL;
count
-------
152
18
(1 row)

SELECT count(*) FROM tbl_tgeompoint3D, tbl_geometry3D
SELECT count(*) FROM tbl_tgeompoint3D,
( SELECT * FROM tbl_geometry3D LIMIT 10 ) t
WHERE shortestLine(g, temp) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeompoint3D t1, tbl_tgeompoint3D t2
SELECT count(*) FROM tbl_tgeompoint3D t1,
( SELECT * FROM tbl_tgeompoint3D LIMIT 10 ) t2
WHERE shortestLine(t1.temp, t2.temp) IS NOT NULL;
count
-------
150
18
(1 row)

SELECT count(*) FROM tbl_tgeogpoint, tbl_geography
SELECT count(*) FROM tbl_tgeogpoint,
( SELECT * FROM tbl_geography LIMIT 10 ) t
WHERE shortestLine(g, temp) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeogpoint t1, tbl_tgeogpoint t2
SELECT count(*) FROM tbl_tgeogpoint t1,
( SELECT * FROM tbl_tgeogpoint t2 LIMIT 10 ) t2
WHERE shortestLine(t1.temp, t2.temp) IS NOT NULL;
count
-------
148
18
(1 row)

SELECT count(*) FROM tbl_tgeogpoint3D, tbl_geography3D
SELECT count(*) FROM tbl_tgeogpoint3D,
( SELECT * FROM tbl_geography3D LIMIT 10 ) t
WHERE shortestLine(g, temp) IS NOT NULL;
count
-------
9400
900
(1 row)

SELECT count(*) FROM tbl_tgeogpoint3D t1, tbl_tgeogpoint3D t2
SELECT count(*) FROM tbl_tgeogpoint3D t1,
( SELECT * FROM tbl_tgeogpoint3D LIMIT 10 ) t2
WHERE shortestLine(t1.temp, t2.temp) IS NOT NULL;
count
-------
150
18
(1 row)

SELECT st_astext(temp::geometry) FROM tbl_tgeompoint LIMIT 10;
Expand Down

0 comments on commit 2d394e2

Please sign in to comment.