Slow SDO_RELATE operation on a spatial view
Hi Folks,
I need some help to understand what's going on with a spatial query that is taking so long to be executed (about 7 minutes).
I have a spatial view as below:
create or replace view v_lote_fiscal_relac as
select
lf.objectid,lf.numbloco,lf.setor,lf.quarteirao,lf.origem,lf.tipo,lf.nome,lf.superquadra,lf.quadra,lf.area,lf.observacao,lf.motivo,lf.data,lf.matricula,
vlf.idf_lote,vlf.ind_tipo_lote,vlf.num_lote,vlf.num_seq_lote,vlf.num_setor,vlf.num_quarteirao,vlf.mtr_area_real,vlf.des_tipo_categoria,
lf.geom
from
GEOSMFAGP.Lote_Fiscal lf, IMO_VW_LOTE_FISCAL@POAGEO vlf
where
retorna_num_lote(lf.numbloco) = vlf.num_lote AND
retorna_num_seq_lote(lf.numbloco) = vlf.num_seq_lote;
The functions retorna_num_lote and retorna_num_seq_lote just do a substr to extract information from lf.numbloco column
This is the spatial query created by a mapping application
SELECT
OBJECTID
FROM
GEOPONTO.V_LOTE_FISCAL_RELAC T
WHERE
SDO_RELATE(T.GEOM,
SDO_GEOMETRY(2003,1010101,NULL,
SDO_ELEM_INFO_ARRAY(1,1003,1),
SDO_ORDINATE_ARRAY(180514.7833451195,1663508.6932339652,
180514.84948680276,1663504.0633161366,
180517.6274375,1663503.9971744534,
180517.69357918325,1663508.4948089155,
180514.7833451195,1663508.6932339652)), 'mask=ANYINTERACT') = 'TRUE'
Please, correct me if I'm wrong, but it looks like the query will first get all the records that satisfy the where clause and then apply the spatial filter on this resultset.
How can it be improved?
I did some tests using SQL Developer (SQL Profiler) and it was possible to create a better execution plan to this query. The time was reduced to 4 seconds.
But the SQL Profile seems to have effect only to the query analyzed. I mean, if a change the sdo_geometry parameter, the query takes 7 minutes again.
Any ideas?
Regards,
Luis
Hi Stefan,
Please, see below the Explain Plan that I mentioned and the SQL Profiler command that makes the query be executed very fast.
*1- Original*
Plan hash value: 2780585567
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
| 0 | SELECT STATEMENT | | 4808 | 1596K | 25 (0)| 00:00:01 | | |
| 1 | NESTED LOOPS | | 4808 | 1596K| 25 (0)| 00:00:01 | | |
| 2 | REMOTE | IMO_VW_LOTE_FISCAL | 25553 | 648K | 25 (0)| 00:00:01 | POAGEO | R->S |
|* 3 | TABLE ACCESS BY INDEX ROWID| LOTE_FISCAL | 1 | 314 | 25 (0)| 00:00:01 | | |
|* 4 | DOMAIN INDEX | XSPLOTE_FISCAL_GEO | | | 0 (0)| 00:00:01 | | |
uery Block Name / Object Alias (identified by operation id):
1 - SEL$F5BB74E1
2 - SEL$F5BB74E1 / VLF@SEL$2
3 - SEL$F5BB74E1 / LF@SEL$2
4 - SEL$F5BB74E1 / LF@SEL$2
Predicate Information (identified by operation id):
3 - filter("VLF"."NUM_LOTE"="RETORNA_NUM_LOTE"("LF"."NUMBLOCO") AND
"VLF"."NUM_SEQ_LOTE"="RETORNA_NUM_SEQ_LOTE"("LF"."NUMBLOCO"))
4 - access("MDSYS"."SDO_RELATE"("LF"."GEOM","MDSYS"."SDO_GEOMETRY"(2003,1010101,NULL,"SDO_ELEM_INFO_ARRA
Y"(1,1003,1),"SDO_ORDINATE_ARRAY"(180514.7833451195,1663508.6932339652,180514.84948680276,1663504.063316136
6,180517.6274375,1663503.9971744534,180517.69357918325,1663508.4948089155,180514.7833451195,1663508.6932339
652)),'mask=ANYINTERACT')='TRUE')
*2- Using SQL Profile*
Plan hash value: 3617866586
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
| 0 | SELECT STATEMENT | | 4808 | 1596K| 485 (1) | 00:00:06 | | |
|* 1 | HASH JOIN | | 4808 | 1596K| 485 (1) | 00:00:06 | | |
| 2 | TABLE ACCESS BY INDEX ROWID| LOTE_FISCAL | 1882 | 577K| 459 (1) | 00:00:06 | | |
|* 3 | DOMAIN INDEX | XSPLOTE_FISCAL_GEO | | | 0 (0) | 00:00:01 | | |
| 4 | REMOTE | IMO_VW_LOTE_FISCAL | 25553 | 648K| 25 (0) | 00:00:01 | POAGEO | R->S |
uery Block Name / Object Alias (identified by operation id):
1 - SEL$F5BB74E1
2 - SEL$F5BB74E1 / LF@SEL$2
3 - SEL$F5BB74E1 / LF@SEL$2
4 - SEL$F5BB74E1 / VLF@SEL$2
Predicate Information (identified by operation id):
1 - access("VLF"."NUM_LOTE"="RETORNA_NUM_LOTE"("LF"."NUMBLOCO") AND
"VLF"."NUM_SEQ_LOTE"="RETORNA_NUM_SEQ_LOTE"("LF"."NUMBLOCO"))
3 - access("MDSYS"."SDO_RELATE"("LF"."GEOM","MDSYS"."SDO_GEOMETRY"(2003,1010101,NULL,"SDO_ELEM_INFO_ARRA
Y"(1,1003,1),"SDO_ORDINATE_ARRAY"(180514.7833451195,1663508.6932339652,180514.84948680276,1663504.063316136
6,180517.6274375,1663503.9971744534,180517.69357918325,1663508.4948089155,180514.7833451195,1663508.6932339
652)),'mask=ANYINTERACT')='TRUE')
Recommendation (estimated benefit: 99.96%)
- Consider this SQL Profile:.
execute dbms_sqltune.accept_sql_profile(task_name => 'staName68255',
task_owner => 'GEOPONTO', replace => TRUE);
After the execution o the command above, the same query is executed in 3 seconds.
P.S: I Cannot change the view, the column is indexed and SDO_FILTER will not work for me, because I need an exact match.
Regards,
Luis
Similar Messages
-
Sdo_filter fail when query against a spatial view in different schema
We have a table with X,Y coordinates and would like to run spatial query against it. We do not want to change the table structure, so we opt to use a function based index. USER_SDO_GEOM_METADATA is updated and index is built. Then we created a view with spatial column from the table. Everything works fine with the user who owns the table and view.
When we try to run a spatial query against the view from a different user, it failed with error. However, if we substitute the select from my_view* with the actual SQL statement that created the view, it works. So it looks like Oracle refuse to acknowledge the spatial index if accessed via view. Here is some simplified scripts:
--- connect as USER1.
--update meta data
INSERT INTO USER_SDO_GEOM_METADATA ( TABLE_NAME, COLUMN_NAME, DIMINFO, SRID ) VALUES
('LOCATIONS', 'MDSYS.SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL)',
SDO_DIM_ARRAY( SDO_DIM_ELEMENT('X', 1300000, 1600000, 1), SDO_DIM_ELEMENT('Y', 400000, 700000, 1) ), 2264 );
--created index
CREATE INDEX LOCA_XYGEOM_IDX ON LOCATIONS
( SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL)
) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
--create view
CREATE VIEW USER1.MY_VIEW AS SELECT ID ,X_COORD,Y_COORD, SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL) SHAPE
FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0;
-- run spatial query from view, works fine by user1 by failed on user2.
SELECT SHAPE FROM (
SELECT * FROM USER1.MY_VIEW
) a WHERE sdo_filter (shape, sdo_geometry ('POLYGON ((1447000 540000, 1453000 540000, 1453000 545000, 1447000 545000, 1447000 540000))', 2264), 'querytype=window') = 'TRUE';
-- run spatial query from table directly, simply replace the view with actual statements that created the view. works fine by user1 AND user2.
SELECT SHAPE FROM (
SELECT ID ,X_COORD,Y_COORD, SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL) SHAPE
FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0
) a WHERE sdo_filter (shape, sdo_geometry ('POLYGON ((1447000 540000, 1453000 540000, 1453000 545000, 1447000 545000, 1447000 540000))', 2264), 'querytype=window') = 'TRUE';
When run against the view by user2, the error is:
ORA-13226: interface not supported without a spatial index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
ORA-06512: at "MDSYS.SDO_3GL", line 1173
13226. 00000 - "interface not supported without a spatial index"
*Cause: The geometry table does not have a spatial index.
*Action: Verify that the geometry table referenced in the spatial operator
has a spatial index on it.
Note, the SELECT SHAPE FROM (****) A WHERE SDO_FILTER(....) syntax is a third party application, all we have control is the part inside "(select ...)".
So it appears Oracle is treating view differently. Have attempted fake the view name into USER_SDO_GEOM_METADATA, did not work. Also, granted select on the index table to user2, did not work.
if we re-created the view in user2 schema, it worked for user2 but not user1, so it's not something we can do for every user.
Searched the forum, no good match found. A few posts talked about "union all" in view caused the problem but I do not have the union.
We are only use Oracle 10g Locator, not full spatial edition.
Any ideas?
Thanks!
Edited by: liu.284 on Oct 4, 2011 12:08 PMIt seems a bug, where a function-based spatial index is not correctly handled in a view query transformation.
Not sure if the following works for you or not.
add a new column "shape" (mdsys.sdo_geometry) in table locations, use a trigger and x_coord/y_coord
to set values for this new column, and just create a normal spatial index on this new column. (drop the
function-based spatial index). And create a view like:
CREATE VIEW USER1.MY_VIEW2 AS SELECT ID , X_COORD, Y_COORD, SHAPE
FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0; -
LAYER_GTYPE parameter in SDO_RELATE operator
Hello, Dan :)
In documentation about Spatial i found that the SDO_POINT member of SDO_GEOMETRY is used to optimize different geometric operations over the geometry. From other side the additional parameter LAYER_GTYPE=POINT is required in order SDO_RELATE operator works more efficiently on point data. Is it necessary to define LAYER_GTYPE=POINT inside SDO_RELATE when every geometry defined in the column has defined SDO_POINT and NULLs for SDO_ELEM_INFO_ARRAY and SDO_ORDINATES or i can ommit this parameter and still get the optimized work of SDO_RELATE ?
I use 8.1.6 and planning to upgrade to 8.1.7 ASAP.
Thank you.
I middletime use SDO_RELATE without this parameter to achieve universal use of the procedure.Hi,
You should use layer_gtype=point in either case, i.e. whenever the layer contains ONLY point data then layer_gtype=point will help.
Whether the point data is stored in the elem_info_array and ordinate array or in the point_type is not important when deciding when to use layer_gtype=point. -
Hi everybody
i want to create spatial view in the sqlserver 2008 . i m creating relationship between entity . i m pasting my sql query :
SELECT sde.STATE.OBJECTID, sde.STATE.StateID, sde.STATE.StateName, sde.STATE.SHAPE, SUM(sde.Population.Population) AS Expr1
FROM sde.STATE INNER JOIN
sde.Population INNER JOIN
sde.TEHSIL ON sde.Population.TehsilID = sde.TEHSIL.TehsilID INNER JOIN
sde.DISTRICT ON sde.TEHSIL.DistrictID = sde.DISTRICT.DistrictID ON sde.STATE.StateID = sde.DISTRICT.StateID
GROUP BY sde.STATE.OBJECTID, sde.STATE.StateID, sde.STATE.StateName, sde.STATE.SHAPE
when i try to save this query it gives the error .
The type "gemometry " is not comparable .It can not be used in the GROUP BY clause.
when i not include shape in GROUP BY clause it gives following error
Column 'sde.STATE.SHAPE ' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
please if any one has created just informed meShould just be a matter of doing the aggregation in a subquery. Try:
SELECT sde.STATE.OBJECTID
, sde.STATE.StateID
, sde.STATE.StateName
, sde.STATE.SHAPE,
, q1.SumOfPopulation
FROM sde.STATE
JOIN (
SELECT StateID,
, SUM(sde.Population.Population) as SumOfPopulation
FROM sde.STATE
JOIN sde.DISTRICT ON sde.STATE.StateID = sde.DISTRICT.StateID
JOIN sde.TEHSIL ON sde.TEHSIL.DistrictID = sde.DISTRICT.DistrictID
JOIN sde.Population ON sde.Population.TehsilID = sde.TEHSIL.TehsilID
GROUP BY StateID
) q1 ON q1.StateID = sde.STATE.StateID -
Union of tables to give a spatial view
I have a series of tables that i am trying to join together and display in a view. Some of them have a slightly different structure. They all have either a east/north, easting or northing, or a centrex and centrey. I then want the centroids for each polygon. If i run the select statements seperatly they select what i want, however when i put a union in it gives the following error message :
ERROR at line 1:
ORA-22901: cannot compare nested table or VARRAY or LOB attributes of an object
type
The SQL is as follows :
CREATE or REPLACE VIEW ALLSITES_V AS
select
'SSSI' desg,SSSI_NAME site_name,SSSI_ID site_code,EAST CENTREX,NORTH CENTREY,TO_NUMBER(sssi_id) isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
from SSSI
union
select
'SPA' desig,SPA_NAME site_name,SPA_CODE site_code,EASTING CENTREX,NORTHING CENTREY,ISIS_ID isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
from SPA
union
select
'RAMSAR' desg,RAMSAR_NAME site_name,RAMSAR_CODE site_code,EASTING CENTREX,NORTHING CENTREY,ISIS_ID isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
from RAMSAR
union
select
'SAC' desg,SAC_NAME site_name, SITE_CODE site_code,ISIS_ID isis_id,CENTREX,CENTREY,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
from SAC
I am assuming it is because i have not used the SDO_GEOM function in it's correct format. I would also like the view to show the centrex and y and also the MBR. It is will be used when passed through a WMS. I have missed out something fairly fundermental but i am not sure how to incorperate it.Hi,
I created view:
CREATE OR REPLACE VIEW VIEW_ALL as
SELECT
ID, GEOMETRIE_ZNACKA as GEOMETRIE
FROM
TAB_A
WHERE
GEOMETRIE_ZNACKA is not null
UNION ALL
SELECT
ID, GEOMETRIE_SIPKA as GEOMETRIE
FROM
TAB_B
WHERE
GEOMETRIE_SIPKA is not null
I inserted geometry metadata:
insert into mdsys.user_sdo_geom_metadata (table_name,column_name,diminfo,SRID)
values ('VIEW_ALL','GEOMETRIE',MDSYS.SDO_DIM_ARRAY (MDSYS.SDO_DIM_ELEMENT('X',431700, 904600,0.01),
MDSYS.SDO_DIM_ELEMENT('Y',935200, 1227300,0.01)),2065);
Tables TAB_A and TAB_B have spatial index on column with geometry.
When I view the view VIEW_ALL in the spatial view (Georaptor) we get an error "ORA-01446".
Geometry data of tables TAB_A and TAB_B (directly) is viewed in spatial view (Georaptor) corectly.
Thanks
Petr Soucek -
Spatial view 3D effect plugin causing After Effects to crash.
I installed the Spatial View stereoscopic effect plugin today, only using the 30 day trial.
However, every time I try to apply the effect or adjust some the settings, After Effects crashes.
Anyone else had the same problem?
I really need this plugin badly Q_QI think this is too specialised a question to get an answer :/
Nevermind, I've decided to go with Tridef, it's a lot cheaper and easier to use.
If anyone is looking to convert 2D video to 3D analglyph, it seems the way to go. -
Iphone 3G is very slow in operation
Hi,
My iphone 3G is getting very slow in operation. I have very less applications installed also. opening a message, a contact and any application is slow. I have done restart also. nothing is helping. kindly suggest.
chetanchetan.sr wrote:
...nothing is helping. kindly suggest.
chetan
Some Users have Reported that a Restore as New has helped Resolve issues...
Backup and Set Up as New Device
http://support.apple.com/kb/HT4137 -
Very, very slow file operations
I needed to make a specific change to an exif field of some images. So what I did was to move identify the files that I needed to change in Lightroom (they were in various folders on my disk) and move them to other folders so they would be easy to operate on. Then I used exiftool to change the field in these files, and then I thought it would be easy to read in the changed data and move them back to their original folders in Lightroom. What I found included:
I tried to Synchronize Metadata on the folders after changing the exif field. One folder had about 500 images in it, the other about 2,000. After 3 hours, the progress bar had barely moved, and I aborted.
When I tried to quit Lightroom it said that it was "writing metadata", even tho the synchronization had changed the external data and it should only have been reading metadata. I quit anyways and rebooted.
After rebooting, and relaunching Lightroom I looked at the "metadata status" column in Grid view. It was (as always, it seems) completely wrong about which files were up to date.
I was able to "read metadata" on these 2,500 images in "only" about an hour or two. Note that I didn't ask Lightroom to update the cached images, only to read the metadata. Reading metadata at 1,000-2,000 images an hour seems exceptionally slow.
Now I am trying to move the files back to their correct folders. I dragged about 1,000 raw images (CR2 + xmp) from one folder to another in Lightroom. Three hours later it is about 50% finished according to the progress bar. I'm going to bed and hope it will finish by the morning. I have to move all the other images as well, but because Lightroom won't update the filter bars in Grid View while moving files, I can't start these moves until Lightroom finishes the first.
Do other people fine absolutely absurd speeds for file operations in Lightroom? Is there any solution other than quitting and rebooting (which doesn't always work)? I hate to quit in the middle of a synchronize, read metadata, or move files operation even when it seems to be barely chugging along, because I am afraid that when I abort the operation, I will somehow leave a file orphaned, or it's metadata out of sync (which happens to me all the time, but I never know why).
When I am doing other operations I also find that I can use Lightroom for only a few hours before it gets so slow that I quit and reboot, after which operations speed up considerably. This doesn't seem like it should be necessary for a "modern" program and operating system, but in my experience it is.
I'm using a Macintosh (4 core i7, 16 GB of RAM), Mavericks latest, Lightroom 5.5, and a RAID disk, so hardware shouldn't be limiting. During this last interminable copy operation, it appears that Lightroom is pegged at 100% of a processor (core).Sorry, but I don't think your workaround works. I am moving a bunch of files from one folder to various folders (using Lightroom to discriminate between files based on their exif/iptc values), then I change them using an outside program (exiftool), then I put them back in their original folders. This involves having Lightroom read in the new data in the files, which is what is so slow. Reconnecting, if I understand it, is for when you move a folder of files to another location, and Lightroom needs to be informed of that move.
As I pointed out, the problem is that Lightroom gets progressively and painfully slower the more you use it. But quitting and restarting can be annoying if you are in the middle of an operation because you can lose context (especially if you restart your computer, which seems to help).
And I do optimize my database nearly daily when using Lightroom.
I would spend the time to fully document this problem and report it as a bug, but my experience is that Adobe shows no evidence of actually reading my bug reports, let alone responding to them. -
Set operator NE in Database View creation in join condition
Hi Experts,
I have a requirement to set NE(not equal) operator in join condition of Database View creation. Could you please help me how to set in operator.
Join condition :
Ex : BSAK-AUGBL NE BSAK-BELNR.
You know that by default operator is '='. i want to set NE in place of '='.
Thanks,Hi Chinna,
Check whether if there is any possibility or not to include more key fields like bukrs, lifnr, gjahr etc in the where condition, so that you query may result faster. Then, there won't be any necessary to create the view.
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa -
Very Slow Copy Operation on HP Pavilion 15 p001tx
Hi everyone. I recently bought the HP Pavilion 15 p001tx. Here are the Specifications if you need them
Intel Core i5 4210U 1.7Ghz ,Turbo Boost to 2.4GHz
4 GB DDR3 RAM
1 TB HDD
Nvidia Geforce 830M 2GB DDR3
My problem is with extremely slow copying/moving operation on USB drives. I mean I could get only 5-15 Mbps while copying/moving.
I am aware that I am using a USB 3.0 Flash Drive connected to the USB 3.0 slot but a constant 5-15 Mbps is ridiculus. I have a friend who has the same model and he could get 35-40Mbps of transfer speed.
I ran the HP utility and installed the latest device drivers for Windows 8.1. I have not run into problems while copying / moving files within the harddrive as it runs at a decent 45 Mbps , in fact here is the CrystalDisk Mark benchmark of my HDD:
* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]
Sequential Read : 92.794 MB/s
Sequential Write : 89.059 MB/s
Random Read 512KB : 27.382 MB/s
Random Write 512KB : 34.493 MB/s
Random Read 4KB (QD=1) : 0.355 MB/s [ 86.6 IOPS]
Random Write 4KB (QD=1) : 1.050 MB/s [ 256.3 IOPS]
Random Read 4KB (QD=32) : 0.975 MB/s [ 237.9 IOPS]
Random Write 4KB (QD=32) : 0.819 MB/s [ 199.9 IOPS]
Test : 1000 MB [C: 14.2% (64.9/455.6 GB)] (x5)
Date : 2014/09/17 20:37:37
OS : Windows 8.1 [6.3 Build 9600] (x64)
Now this is the benchmark for a USB
* MB/s = 1,000,000 byte/s [SATA/300 = 300,000,000 byte/s]
Sequential Read : 15.174 MB/s
Sequential Write : 7.067 MB/s
Random Read 512KB : 15.702 MB/s
Random Write 512KB : 0.654 MB/s
Random Read 4KB (QD=1) : 4.079 MB/s [ 995.7 IOPS]
Random Write 4KB (QD=1) : 0.006 MB/s [ 1.4 IOPS]
Random Read 4KB (QD=32) : 4.491 MB/s [ 1096.4 IOPS]
Random Write 4KB (QD=32) : 0.005 MB/s [ 1.3 IOPS]
Test : 1000 MB [H: 0.0% (0.0/3855.0 MB)] (x5)
Date : 2014/09/17 21:54:50
OS : Windows 8.1 [6.3 Build 9600] (x64)
Please help me with this guys... I need to transfer lots of data to my external HDD.
I also have another problem which is the Bluetooth doesnt discover any devices around ,neither does any other device detect it. It just keeps saying searching forever.I also have same problem which is the Bluetooth doesnt discover any devices around ,neither does any other device detect it. It just keeps saying searching forever.connected then within seconds it shows not connected
-
How do I get all Finder windows to open in spatial view?
How do I get all Finder windows without special view options set to open in the 'spatial' mode (without the toobar or sidebar)? The ones I specifically change stay that way, but I want all new and old folders to be like that too.
That's called the simple Finder mode. You would need to configure that as part of Parental Controls in the Accounts preferences. To make any Finder window appear that way jut click on the gadget in the top right corner of the Finder window.
-
Sdo_relate in alternate user with views.
Hello,
I am using Oracle 8.1.7.2 and creating a view as follows.
CREATE OR REPLACE VIEW REPORT_STREETINFO AS
SELECT DT.ID, MKT.CODE MKT_CODE, PRIM_NAME,
NVL(MIN(DECODE(ST.FROMNRLE, 0, NULL, ST.FROMNRLE)),0)
MIN_FROMNRLE,
MAX(ST.TONRLE) MAX_TONRLE,
NVL(MIN(DECODE(ST.FROMNRRI, 0, NULL, ST.FROMNRRI)),0)
MIN_FROMNRRI,
MAX(ST.TONRRI) MAX_TONRRI,
MKT.NAME MKT_NAME, MKT.NAME2 MKT_NAME2, MKT.STREET MKT_STREET,
MKT.CITY MKT_CITY,
MKT.ZIP MKT_ZIP,
MKT.PO_BOX MKT_POBOX
FROM STREETINFO ST, DISTAREA DT, MARKET MKT, DISTAREA_WA
DTWA,WALKERAREA WA
WHERE PRIM_NAME IS NOT NULL AND
(ST.FROMNRLE != 0 AND ST.TONRLE != 0 OR
ST.FROMNRRI != 0 AND ST.TONRRI != 0) AND
DTWA.DISTAREA_ID = DT.ID AND
WA.WASID = DTWA.WASID AND
MKT.SRNO = DT.MARKET_ID AND
MDSYS.SDO_RELATE(ST.GEOLOC, WA.GEOLOC, 'mask=
(inside+coveredby+on)
querytype=window') = 'TRUE'
GROUP BY PRIM_NAME, MKT.CODE, DT.ID,
MKT.NAME, MKT.NAME2, MKT.STREET, MKT.CITY, MKT.ZIP, MKT.PO_BOX
ORDER BY PRIM_NAME
I grant the rights to this above view to an alternate user. When
I fire a query like
SELECT PRIM_NAME FROM REPORT_STREETINFO WHERE ID = 22;
from the owner of the view I have no problems but when I fire
this query from alternate user I get error
ORA-03113 end-of-file on communication channel.
I checked out the documentation which states from physical
failure but this is definately not the case.
Any help on this problem will be appretiated.
Amol.Hello Ravi,
I am posting a spool file which shows the steps I have followed
and error that I get. I have taken care with the grants from
mdsys for the SDO_RELATE and all the other operators.
DEV>SHO USER
USER ist "GEODIS"
DEV>CREATE OR REPLACE VIEW REPORT_STREETINFO AS
2 SELECT DT.ID, MKT.CODE MKT_CODE, PRIM_NAME,
3 NVL(MIN(DECODE(ST.FROMNRLE, 0, NULL, ST.FROMNRLE)),0)
MIN_FROMNRLE,
4 MAX(ST.TONRLE) MAX_TONRLE,
5 NVL(MIN(DECODE(ST.FROMNRRI, 0, NULL, ST.FROMNRRI)),0)
MIN_FROMNRRI,
6 MAX(ST.TONRRI) MAX_TONRRI,
7 MKT.NAME MKT_NAME, MKT.NAME2 MKT_NAME2, MKT.STREET
MKT_STREET, MKT.CITY MKT_CITY,
8 MKT.ZIP MKT_ZIP,
9 MKT.PO_BOX MKT_POBOX
10 FROM STREETINFO ST, DISTAREA DT, MARKET MKT, DISTAREA_WA
DTWA,WALKERAREA WA
11 WHERE PRIM_NAME IS NOT NULL AND
12 (ST.FROMNRLE != 0 AND ST.TONRLE != 0 OR
13 ST.FROMNRRI != 0 AND ST.TONRRI != 0) AND
14 DTWA.DISTAREA_ID = DT.ID AND
15 WA.WASID = DTWA.WASID AND
16 MKT.SRNO = DT.MARKET_ID AND
17 MDSYS.SDO_RELATE(ST.GEOLOC, WA.GEOLOC, 'mask=
(inside+coveredby+on)
18 querytype=window') = 'TRUE'
19 GROUP BY PRIM_NAME, MKT.CODE, DT.ID,
20 MKT.NAME, MKT.NAME2, MKT.STREET, MKT.CITY, MKT.ZIP,
MKT.PO_BOX
21 ORDER BY PRIM_NAME
22 /
View wurde angelegt.
DEV>SELECT PRIM_NAME FROM REPORT_STREETINFO WHERE ID = 108;
PRIM_NAME
Altenhagener
Weg
Alter
Zollweg
Am
Knill
Am
Kroog
Am
Lehmberg
Babenstieg
Bargteheider
Strasse
Bekassinenau
Blomeweg
Boltenhagener
Strasse
Bublitzer
Strasse
Carlssonweg
Farmsener
Zoll
Finkenfurth
Grvmitzer
Weg
Grundherrenstrasse
Herwardistrasse
Hohenkamp
Hoher
Berg
Im
Wiesengrund
Jacobshagener
Weg
Kohvvedstrasse
Kvsliner
Strasse
Krohnsheide
K|hlungsborner
Strasse
Nienhagener
Strasse
Pfefferstrasse
Rahlstedter
Stieg
Rahlstedter
Weg
Raschweg
R|genwalder
Strasse
Rummelsburger
Strasse
Sandkule
Scharbeutzer
Strasse
Sierksdorfer
Strasse
Stargarder
Strasse
Thiessenweg
Timmendorfer
Stieg
Timmendorfer
Strasse
Treptower
Strasse
Wolliner
Strasse
41 Zeilen ausgewdhlt.
DEV>GRANT SELECT ON REPORT_STREETINFO TO PWEIH;
Benutzerzugriff (Grant) wurde erteilt.
DEV>CREATE SYNONYM PWEIH.REPORT_STREETINFO FOR
GEODIS.REPORT_STREETINFO;
Synonym wurde angelegt.
DEV>CONN PWEIH/PWEIH@DEVELOP
Connect durchgef|hrt.
DEV>DESC REPORT_STREETINFO;
Name Null? Typ
ID NOT NULL NUMBER(10)
MKT_CODE VARCHAR2(10)
PRIM_NAME VARCHAR2(40)
MIN_FROMNRLE VARCHAR2(40)
MAX_TONRLE NUMBER
MIN_FROMNRRI VARCHAR2(40)
MAX_TONRRI NUMBER
MKT_NAME VARCHAR2(40)
MKT_NAME2 VARCHAR2(40)
MKT_STREET VARCHAR2(40)
MKT_CITY VARCHAR2(40)
MKT_ZIP VARCHAR2(9)
MKT_POBOX VARCHAR2(40)
DEV>SELECT PRIM_NAME FROM REPORT_STREETINFO WHERE ID = 108;
SELECT PRIM_NAME FROM REPORT_STREETINFO WHERE ID = 108
FEHLER in Zeile 1:
ORA-03113: Unerwartetes \bertragungsende in Kommunikation
DEV>SPOOL OFF;
Regards,
Amol. -
Slow SDO_RELATE when using group by.. please help!!
Hi All,
I'm fairly new to the spatial side of Oracle so please go easy on me.
I have 2 tables (a and b), each containing line geometries. There is a one(a) to many(b) relationship between the two.
I want to write a query which selects information from table b where the geometries in table b are completely covered by the geometries in table a, but the returned info is grouped by the rows in table a.
Here's my code:
select
a.route_id,
a.step,
max(b.gritter_status),
sum(b.salt_usage)
from
tbl_routedirs a, tbl_routelinks b
where
a.route_id = b.route_id and
sdo_covers(a.geoloc, b.geoloc) = 'TRUE'
group by
a.route_id, a.step
The query is extremely slow, taking up to 15 minutes to execute...The thing which is confusing me is without the group by clause the statement executes in under half a second.
I have checked all indexes etc - all are valid. I've tried re-ordering the tables in the from clause as ive read this can be a factor, and granted i have little knowledge as to what to swap where but this appeared to have no impact on the speed.
Any suggestions would be warmly welcomed... Thankyou.
Edited by: user8760008 on 27-Aug-2009 07:08 - i copied the script and didnt add the aggregate functions on the selected columns...If that's the case, please try:
select /*+ leading(a) use_nl(a b) index(b your_index_on_b.geoloc) */
a.route_id,
a.step,
max(b.gritter_status),
sum(b.salt_usage)
from
tbl_routedirs a, tbl_routelinks b
where
a.route_id = b.route_id and
sdo_coveredby(b.geoloc, a.geoloc) = 'TRUE'
group by
a.route_id, a.step
i.e. to have a nested loops join, and take a small table as outer.
Note you may not need all three hints to get the nested loops join plan. -
MDT 2012 \ WinPE 3.0 Slow Install Operating System
I have an issue with a custom wim I have incorporated into my Task sequence. When I use a custom Wim, at the point where the MDT Tasksequence begins to "Install Operating System" it slows down to a crawl. What previously took 5-10 minutes on a
previous wim, is now taking 30-50. When the "Install Operating System" task begins, it starts a at a very decent rate, you can see the percentage or time increasing/changing every few seconds with out issue, but when it gets to 30% completion, it
starts to slow down dramatically. Eventually it will get to 100% Completion, where it will stay for the next 5 minutes, at which point it will apply the unattend.xml which will also take a very very long time to complete.
Once it reboots from applying the Unattend.xml everything runs normal.
My Setup:
I am using MDT 2012 - with WinPE3.0
To create my Custom Wim I did the following:
I created a brand new standard tasksequence, to deploy an OS to a machine, install updates then sysprep and capture to a wim. I set a custom variable in the tasksequence which set DoCapture=Yes. This allowed me to Capture the Operating system after the windows
updates were done without having to do any additional steps. I then imported the Image into the operating systems section of my MDT Deployment share, and incorporated it into my previous Tasksequence.
I have also noticed that the size of the wim file I created is about 1.5 gigs larger than my previous wim.
Steps I've Taken for remediation:
I've tried rebuilding my boot.wim several times.
Increased the scratch size from 32 -> 64 -> 256 -> 512MB
Removed unnecessary drivers from the boot.wim
Any ideas you guys might have with regard to getting my Install Operating System phase to speed up to normal speeds with be greatly appreciated. Is there an extra step with the install.wim that I importing into MDT that I should be doing?I completed a robocopy in the full blown OS to download the 4.9g wim, it takes 1 minute and 36 seconds. It does have gigabit connection active in the full blown os.
When I am running WinPE, Task Manager is showing my local area connection is running at 1Gbps.
Another discrepancy I'm noticing is that @ 12:16:04 [Line1801] the task sequence finishes apply the wim. It takes 10 minutes for it to start the next task found on Line 1807. Any Ideas on why it taking so long to apply the bootsect.exe
command?
I did disable the "Apply Patches" task, and it did remove 20 minutes by not applying those patches. Thank you for that suggestion.
MCSA Server 2008R2 \ 2012 MCSE Server Infrastructure CCNA -
Differences in operation of Adobe Content Viewer in IPad and IPhone
Seem to have different operation of Content Viewer on IPhone and IPad. On Iphone if I download a folio from the Library I can access Library again and select another folio by tapping top left hand corner. On IPad no such functionality have to delete and reinstall Contect Viewer and download a new folio. Is that how it should work?
heh. That's certainly not how it should work. So you said that you completely deleted the Content Viewer from the iPad? Then reinstalled?
Maybe you are looking for
-
My Macbook Pro is so slow-.HELP!
Hello everyone, I have had my Macbook pro for about 4 years now and it is incredibly slow. I believe it is because of the lack of space on the hard drive or something like that. I am not very tech savvy but when I went to my local Apple store they
-
itunes error (-42404) -- Okay, getting a little frustrated (but then again, who isn't a little frustrated?). I recently tried to upgrade iTunes software a few days ago but it failed. What is (-42404) error code mean? I get the following: (1) iTunes
-
Active ODP when both 9 and 10g are installed...
I have both ODP 9i and ODP 10g (along with the Oracle 10g client) installed on my workstation. How does one set up one or the other to be the 'active' ODP client? For instance, I have an application that I developed under ODP 9i... because I develope
-
HI SAP GURUS, I have defined fsv as per accounts. FSV gives detail at gl account level i.e figures for the period for each gl account.My client want to have detail as per the companies act separated as per finance expenses, sales expenses etc for eac
-
Help: Slide background showing up on other slides.
I'm using Captivate 6 and I've encountered the following issue with most projects I work on. I've recorded from a software application, and when I publish my project, portions of slide background from some slides show up on other slides. I can't incu