473,756 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_ADDR ESS"
("LOCATION" )
EXTEND USING "DB2GSE "."SPATIAL_INDE X" (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_dista nce(db2gse.st_p oint( 'POINT(
-33.71492167 151.1091933 )' ,1),location )
from gps.gps_paf_add ress addr
where
db2gse.st_dista nce(db2gse.st_p oint('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_dista nce(db2gse.st_p oint( 'POINT(
-33.71492167 151.1091933 )' ,1),location )
from gps.gps_paf_add ress addr
where
db2gse.ST_Conta ins(
db2gse.ST_Polyg on('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_add ress(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 2545
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_ADDR ESS"
("LOCATION" )
EXTEND USING "DB2GSE "."SPATIAL_INDE X" (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_dista nce(db2gse.st_p oint( 'POINT(
-33.71492167 151.1091933 )' ,1),location )
from gps.gps_paf_add ress addr
where
db2gse.st_dista nce(db2gse.st_p oint('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_dista nce(db2gse.st_p oint( 'POINT(
-33.71492167 151.1091933 )' ,1),location )
from gps.gps_paf_add ress addr
where
db2gse.ST_Conta ins(
db2gse.ST_Polyg on('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_add ress(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********@salm at.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
1423
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 spatial extension stil lacks some functionality, and by a web search it seems to me that these functions are missing from year(s). What I need most is the DISTANCE() function beetween two geometric
0
5175
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, insert 2 points, create an index, and to query the table using SDO_NN. -------------------< script for Oracle >---------------------- create table test (shape MDSYS.SDO_GEOMETRY);
1
3730
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, is there any other way to avoid INSERT..SELECT statement ??? Thank You Best regards
0
1611
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 interest is the use of Spatial data. Before I start dropping my questions (a have a few) all over this list, two quick ones to start with:
0
1739
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 anything about it. Any thoughts? Thanks
2
3152
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 genomic data and believe the spatial extender will help in querying. I have to do intersections, subtractions, proximity, etc of ranges in the chromosomes. The database and even some tables include data on all chromosomes of several species. I am...
3
1985
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 problem. However, when I do db2ext => enable table <mytable> for db2image
11
3314
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
3515
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 containing both xml and spatial data fields I can't seem to find a way to alter the table I have created a table containing an id, xmldata field and a ST_Point If I try to drop the xml field with ALTER TABLE TEST DROP COLUMN
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9843
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.