For improve performance, try to create table DEM_PART with RANGE-RANGE partition
SQL> CREATE TABLE DEM_PART
2 (X NUMBER
3 ,Y NUMBER
4 ,Z NUMBER
5 ,LOCATION MDSYS.SDO_GEOMETRY
6 )
7 PARTITION BY RANGE (X)
8 (PARTITION X_119 VALUES LESS THAN (120)
9 ,PARTITION X_120 VALUES LESS THAN (121)
10 ,PARTITION X_121 VALUES LESS THAN (122)
11 ,PARTITION X_122 VALUES LESS THAN (123)
12 );
Table created.
Load point into DEM_PART
SQL>
INSERT INTO dem_part
SELECT x, y, z, point(x, y)
FROM points;
COMMIT;
Use this information to update USER_SDO_GEOM_METADATA
SQL>
INSERT INTO USER_SDO_GEOM_METADATA
VALUES ('DEM_PART','LOCATION',
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X',119.982565,122.02683,10),
SDO_DIM_ELEMENT('Y',21.8673002,25.3523955,10)),4326);
COMMIT;
Create Spatial Index
A better way to create Spatial Index for saving working space and time is listed as following:
CREATE INDEX sdo_dem_part_location ON dem_part (location)
INDEXTYPE IS MDSYS.SPATIAL_INDEX
PARAMETERS ('tablespace=fsms_idex')
LOCAL UNUSABLE;
ALTER INDEX sdo_dem_part_location REBUILD PARTITION X_119;
ALTER INDEX sdo_dem_part_location REBUILD PARTITION X_120;
ALTER INDEX sdo_dem_part_location REBUILD PARTITION X_121;
ALTER INDEX sdo_dem_part_location REBUILD PARTITION X_122;
No comments:
Post a Comment