473,379 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Spatial Extenders index usage

Hi,

I am having trouble getting DB2 to select an index I have created for a
spatial location.

Table definition

create table gps_paf_address
( gnaf_address gnaf_address not null
,GNF_PID varchar(015) not null

,location st_point not null

) in data4k1 index in index4k1 long in long4k1
;
spatial index

CREATE INDEX "GPS "."GPS_PAF_ADDR_S2" ON "GPS
"."GPS_PAF_ADDRESS"
("LOCATION" )
EXTEND USING "DB2GSE "."SPATIAL_INDEX" (0.0001, 0,
0) ;
Tried this no success

select
cast(db2gse.st_x(location)as char(15)) as GNF_LONG

, cast(db2gse.st_y(location)as char(15)) as GNF_LAT
, db2gse.st_distance(db2gse.st_point( 'POINT(
-33.71492167 151.1091933 )' ,1),location )
from gps.gps_paf_address addr
where
db2gse.st_distance(db2gse.st_point('POINT( -33.71492167 151.1091933
)' ,1),location ) < 0.002 selectivity 0.0000001
Tried this no success

select
cast(db2gse.st_x(location)as char(15)) as GNF_LONG

, cast(db2gse.st_y(location)as char(15)) as GNF_LAT
, db2gse.st_distance(db2gse.st_point( 'POINT(
-33.71492167 151.1091933 )' ,1),location )
from gps.gps_paf_address addr
where
db2gse.ST_Contains(
db2gse.ST_Polygon('polygon(( -33.714 151.10
, -33.714 151.12
, -33.715 151.12
, -33.715 151.10
, -33.714 151.10
))',1),
location
) = 1
selectivity 0.0000001
I have performed a Runstats and the grid size has the following stats

[/home/db2inst1] : TATISTICS FOR COLUMN gps.gps_paf_address(location) \
<
USING GRID SIZES (0.0001) SHOW HISTOGRAM WITH 10 BUCKETS"

Number of Rows: 3895220
Number of non-empty Geometries: 3895220
Number of empty Geometries: 0
Number of null values: 0

Extent covered by data:
Minimum X: -37.375902
Maximum X: -28.165696
Minimum Y: 141.011252
Maximum Y: 153.636718

Grid Level 1
------------

Grid Size : 0.0001
Number of Geometries : 3895220
Number of Index Entries : 3895220

Number of occupied Grid Cells : 2326459
Index Entry/Geometry ratio : 1.000000
Geometry/Grid Cell ratio : 1.674313
Maximum number of Geometries per Grid Cell: 2473
Minimum number of Geometries per Grid Cell: 1

Index Entries : 1 2 3 4 10
--------------- ------ ------ ------ ------ ------
Absolute : 3895220 0 0 0 0
Percentage (%): 100.00 0.00 0.00 0.00 0.00

Is there some other action I need to perform or what have I done wrong.
DB2 V8 fixpak 10

May 30 '06 #1
2 2508
Found the problem, appears to be a bug in DB2. The optimiser seems to
be sensitive to columns in the answer set. I left out some columns
from the select not to confuse matters. These appear to have been
important. One was a transform function against a structured data
type. When I removed this reference it operated successfully. Not
sure why the columns returned (and function operating on columns)
should stop the optimiser using the index.


Hi,

I am having trouble getting DB2 to select an index I have created for a
spatial location.

Table definition

create table gps_paf_address
( gnaf_address gnaf_address not null
,GNF_PID varchar(015) not null

,location st_point not null

) in data4k1 index in index4k1 long in long4k1
;
spatial index

CREATE INDEX "GPS "."GPS_PAF_ADDR_S2" ON "GPS
"."GPS_PAF_ADDRESS"
("LOCATION" )
EXTEND USING "DB2GSE "."SPATIAL_INDEX" (0.0001, 0,
0) ;
Tried this no success

select
cast(db2gse.st_x(location)as char(15)) as GNF_LONG

, cast(db2gse.st_y(location)as char(15)) as GNF_LAT
, db2gse.st_distance(db2gse.st_point( 'POINT(
-33.71492167 151.1091933 )' ,1),location )
from gps.gps_paf_address addr
where
db2gse.st_distance(db2gse.st_point('POINT( -33.71492167 151.1091933
)' ,1),location ) < 0.002 selectivity 0.0000001
Tried this no success

select
cast(db2gse.st_x(location)as char(15)) as GNF_LONG

, cast(db2gse.st_y(location)as char(15)) as GNF_LAT
, db2gse.st_distance(db2gse.st_point( 'POINT(
-33.71492167 151.1091933 )' ,1),location )
from gps.gps_paf_address addr
where
db2gse.ST_Contains(
db2gse.ST_Polygon('polygon(( -33.714 151.10
, -33.714 151.12
, -33.715 151.12
, -33.715 151.10
, -33.714 151.10
))',1),
location
) = 1
selectivity 0.0000001
I have performed a Runstats and the grid size has the following stats

[/home/db2inst1] : TATISTICS FOR COLUMN gps.gps_paf_address(location) \
<
USING GRID SIZES (0.0001) SHOW HISTOGRAM WITH 10 BUCKETS"

Number of Rows: 3895220
Number of non-empty Geometries: 3895220
Number of empty Geometries: 0
Number of null values: 0

Extent covered by data:
Minimum X: -37.375902
Maximum X: -28.165696
Minimum Y: 141.011252
Maximum Y: 153.636718

Grid Level 1
------------

Grid Size : 0.0001
Number of Geometries : 3895220
Number of Index Entries : 3895220

Number of occupied Grid Cells : 2326459
Index Entry/Geometry ratio : 1.000000
Geometry/Grid Cell ratio : 1.674313
Maximum number of Geometries per Grid Cell: 2473
Minimum number of Geometries per Grid Cell: 1

Index Entries : 1 2 3 4 10
--------------- ------ ------ ------ ------ ------
Absolute : 3895220 0 0 0 0
Percentage (%): 100.00 0.00 0.00 0.00 0.00

Is there some other action I need to perform or what have I done wrong.
DB2 V8 fixpak 10


Jun 1 '06 #2
pe********@salmat.com.au wrote:
Found the problem, appears to be a bug in DB2. The optimiser seems to
be sensitive to columns in the answer set. I left out some columns
from the select not to confuse matters. These appear to have been
important. One was a transform function against a structured data
type. When I removed this reference it operated successfully. Not
sure why the columns returned (and function operating on columns)
should stop the optimiser using the index.


You may want to have a look here if you're interested in spatial extender
performance tuning:

http://tinyurl.com/aqztc

As for the question why the index was not used originally with the
additional columns, it would be good to have a look at the query plan. I
imagine that the plan is quite different...

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Jun 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michele Locati | last post by:
Hello NG! I'm going to use MySQL to manage spatial data in a website made with PHP. In its manual I've seen that MySQL can manage georeferenced elements (points, lines and so on). But this...
0
by: Kiyoung Yang | last post by:
Hi, I'm using Oracle 9i with the spatial option. It seems that the spatial function, e.g., SDO_NN, does not consider the 3rd element in a point. I tried the following script to create a table,...
1
by: Aguyngueran | last post by:
Is it possible to MERGE two tables having spatial index (index type DOMAIN) on some column ??? I get ORA-29885 domain index is defined on the column to be modified when trying to do this. If not,...
0
by: Gijsbert Noordam | last post by:
------_=_NextPart_001_01C349DA.E4B7E120 Content-Type: text/plain; charset="iso-8859-1" Hi, As a newcomer to this mailing list -- and to the MySQL database environment -- my main field of...
0
by: wayne mcfadden | last post by:
Hi, I'm stumped. Our text extenders stopped working on one database. I think that i'm missing something simple here. The column is enabled... but when you do an index status it doesn't know...
2
by: Belinda | last post by:
Hi. I am just getting started with DB2's spatial extender and could really use some help. Pointers to good docs or examples are welcome. I am using DB2 version 8 on Sun. I have a database of...
3
by: Rolf Schuster | last post by:
On Windows XP SP2, I am trying to create and enable a table for use by an AIV extender. In the extender command line processor (db2ext), I do db2ext => enable database for db2image without a...
11
by: Brad | last post by:
To DB2 Personal Developer Edition GIS users: How do I acquire a spatial extender license key for the DB2 PDE? I expected to be able to use it right out of the box. Brad
1
by: vasilip | last post by:
I'm testing out db2 for a project I'm starting that requires proper xml support and I can't seem to get both xml and spatial data to work well in the same table. Once having created a table...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.