|
IDEA
|
@MichaelVolz I don't have enough experience with the new index type to say one way or the other. I submitted the idea only because that's what Oracle recommends. My uneducated guess is that there wouldn't be a performance gain in most scenarios. If there was, I think Oracle would have mentioned it in the docs. But they actual hint at the opposite, at least when it comes to creating the index. I'm not sure about performance when using the index. 5.1.1 Using System-Managed Spatial Indexes Effective with Release 12.2, spatial indexes can be system-managed by specifying INDEXTYPE=MDSYS.SPATIAL_INDEX_V2 at index creation. You are strongly encouraged to use this index type for all new spatial indexes you create, regardless of whether the spatial table or the spatial index is partitioned, and you may also want to use it if you decide to re-create legacy spatial indexes. The main benefit is simplified spatial index management. This is most beneficial in cases of partitioning, because this new index type eliminates the need for most, if not all, index partitioning management operations. Full support is provided for almost all Oracle Database base table partitioning models, including: Single-level partitioning: range, hash, list Composite partitioning: range-range, range-hash, range-list, list-range, list-hash, list-list, hash-hash, hash-list, hash-range Partitioning extensions: interval (but not interval-based composite partitions), reference, virtual column-based partitioning The old INDEXTYPE=MDSYS.SPATIAL_INDEX (without the “_V2”) is still available for use, It may provide slightly better index creation performance, especially with small data sets and no partitioning involved. You might also want to use the old type if you need to drop a legacy spatial index and then want to re-create it in exactly the same form as it was before. However, in all or almost all cases you will want to specify INDEXTYPE=MDSYS.SPATIAL_INDEX_V2 when creating any spatial index.
... View more
07-07-2022
05:29 AM
|
0
|
0
|
1956
|
|
POST
|
I've noticed that some organizations forget to enable SPATIAL_VECTOR_ACCELERATION in Oracle databases...now that Oracle Spatial is free. Oracle Spatial Vector Acceleration: Flick the Switch So for any of us who use SDO_GEOMETRY, we need to remember to enable that parameter — to make use of it's performance boosting functionality. (It's enabled by default in 21c+.) I just thought I'd mention that...for those of us who were unaware. Note: I've asked the Oracle Spatial team if there's a way to check if SPATIAL_VECTOR_ACCELERATION is enabled (as a non-dba). But I haven't found a solution yet.
... View more
07-07-2022
04:06 AM
|
0
|
7
|
3026
|
|
POST
|
For what it's worth, SDO_Geometry’s SPATIAL_VECTOR_ACCELERATION is disabled in my database (18c), since it's only enabled by default in 21c+. Oracle Spatial Vector Acceleration: Flick the Switch I tried checking to see if it's enabled (from a non-DBA connection) in SQL Developer, but got errors: Check if SPATIAL_VECTOR_ACCELERATION is enabled (as a non-dba) I don't know much about SPATIAL_VECTOR_ACCELERATION. But it sounds like it will make SDO_Geometry even faster in some cases.
... View more
07-07-2022
03:59 AM
|
0
|
0
|
6511
|
|
POST
|
Related idea (doesn't answer your question): ArcGIS should use the new SDO_GEOMETRY spatial index type: SPATIAL_INDEX_V2
... View more
07-07-2022
03:45 AM
|
0
|
0
|
676
|
|
POST
|
Yes, get_coordinates() is undocumented. I've talked to folks on the Oracle Spatial team about that. They plan to document it in the next release. If for some reason we didn't want to use get_coordinates(), maybe since it's undocumented, then there are other ways to get the startpoint X&Y from SDO_GEOMETRY. The performance of the alternative techniques is roughly the same as get_coordinates(), although slightly more complicated: select
v.x,
v.y
from
sidewalks
cross join
sdo_util.getvertices(shape) v
where
v.id = 1 Or with
function
sdo_startpoint_x(shape sdo_geometry) return number is
begin
return shape.sdo_ordinates(1);
end;
function sdo_startpoint_y(shape sdo_geometry) return number is
begin
return shape.sdo_ordinates(2);
end;
select
sdo_startpoint_x(shape) as startpoint_x,
sdo_startpoint_y(shape) as startpoint_y
from
sidewalks Or select json_value((shape).Get_GeoJson(),'$.coordinates[0][0]' returning number) as x, json_value((shape).Get_GeoJson(),'$.coordinates[0][1]' returning number) as y from sidewalks There is also: sdo_lrs.geom_segment_start_pt But that just returns a LRS geometry. We'd still need to get the XY from the SDO_ORDINATES_ARRAY, which can be done via cross join sdo_util.getvertices(shape). But that's more clunky than I'd like. Related: Idea: Add a SDO_ORDINATES member function (for extracting collection elements by index) The nice thing about ST_GEOMETRY is that it's easy to use, well documented, and there aren't several weird ways to do a thing...there's usually just one way to do it. But with SDO_GEOMETRY, as I demonstrated above, it's messier. Is it possible to lookup SDE.ST_GEOMETRY by index? I don't think so. That's part of the problem with ST_GEOMETRY. The ordinates are hidden in a blob. Whereas SDO_GEOMETRY ordinates are in plain sight in an array in an object attribute (easily accessible by index number). Note: With ST_GEOMETRY, we can get a specific point/vertex via the point index number: SDE.ST_PointN. But that's just as slow as SDE.ST_StartPoint. And I assume you weren't really referring to that. It seems hard to make any real claims about performance without testing more here. The time difference just looks too large for these to be equivalent queries. Yes, the "startpoint function test" was just one test for a specific use case. I haven't done any official benchmarking with dozens of documented tests or anything like that. But the test I did was legitimate & correct. And it's a good example of how slow ST_GEOMETRY functions can be when used on a medium-sized dataset. I stand by my statement that ST_GEOMETRY functions are generally slower. I've heard the same from others, including Esri staff.
... View more
07-06-2022
06:23 PM
|
1
|
1
|
6525
|
|
POST
|
I stand by my statement that ST_GEOMETRY functions are generally slow compared to SDO_GEOMETRY functions. I've done lots of testing over the past couple of years. And the results are always the same. But I should clarify that my testing has been with constructor, accessor, and geometry functions. Not relational functions. I've tested dozens of constructor, accessor, and geometry functions, and I consistently find that they're slower than I need them to be. And to be fair, ST_GEOMETRY has been perfectly fast when simply selecting the geometry column from a FC in a map. And the spatial indexing seems to work fine too. But that's not what I was referring to in this post...it's the functions that are slower than SDO_GEOMETRY. I'd be very interested in seeing reproducible examples of ST_GEOMETRY constructor, accessor, or geometry functions being faster than SDO_GEOMETRY. I've not experienced that yet. Here's what I did to make sure the data was apples-to-apples: Created two new line FCs via Catalog with no extra columns, just the OBJECTID and SHAPE. One FC with the ST_GEOMETRY datatype. And one with the SDO_GEOMETRY datatype. Loaded features from an existing FC into the new FCs via the Catalog load tool. Tested equivalent functions for each datatype in queries in SQL Developer. Hit CTRL+END to select all rows in the query, not just the first 50 rows that are selected by default. To me, that seems like a good way to do objective testing for functions. Some additional thoughts on testing: Ideally, the test would be done with auto-generated fake data that can be publicly shared via db<>fiddle or Oracle Live SQL (or whatever works). Then testers could use that public/fake data and load it into our test FCs in our local environments. For example, here's a query that can be used to generate a grid of SDO_GEOMETRY line features: https://community.esri.com/t5/arcgis-enterprise-questions/generate-grid-line-features-using-sql/m-p/1182869/highlight/true#M33343 The grid can be as big as we want, generating more features as needed. That query can be used to create a Query Layer or spatial view in ArcGIS Pro. Then that query/view could be loaded into our test FCs via Catalog...creating features to do the test on. The same kind of thing can be done for polygons using this query: https://community.esri.com/t5/arcgis-pro-questions/convert-grid-lines-to-polygons/m-p/1183816/highlight/true#M56289 And I imagine the first query could be modified to make points instead of lines. As mentioned, I'd be interested to see cases where ST_GEOMETRY functions (constructor, accessor, or geometry) are faster than SDO_GEOMETRY functions. They could be out there...and I just haven't seen them yet.
... View more
07-06-2022
05:51 PM
|
1
|
0
|
6532
|
|
POST
|
(edited) Oracle 18c 10.7.1 EGDB: I thought I'd share a test I did recently — for anyone who might be trying to decide between SDE.ST_GEOMETRY and SDO_GEOMETRY. Select the startpoint X & Y from 14,000 single-part lines: SDE.ST_GEOMETRY: select sde.st_x(sde.st_startpoint(shape)) as startpoint_x, sde.st_y(sde.st_startpoint(shape)) as startpoint_y from sidewalks STARTPOINT_X STARTPOINT_Y ------------ ------------ 668287.112 4869366.88 ... Time: 20 seconds SDO_GEOMETRY select sdo_util.get_coordinate(shape,1).sdo_point.x as startpoint_x, sdo_util.get_coordinate(shape,1).sdo_point.y as startpoint_y from sidewalks STARTPOINT_X STARTPOINT_Y ------------ ------------ 668287.112 4869366.88 ... Time: 0.9 seconds Result: Getting the startpoint XY from SDO_GEOMETRY is 20x faster than SDE.ST_GEOMETRY in this case. That's consistent with the testing I've done over the last couple of years. I've found ST_GEOMETRY functions to be slower than SDO_GEOMETRY in general. Of course, there are benefits to ST_GEOMETRY too, such as it being easier to learn than SDO_GEOMETRY (in my experience). I just thought I'd share those results in case they're useful to anyone.
... View more
07-06-2022
02:29 PM
|
1
|
9
|
6573
|
|
POST
|
I don't have a way to easily do screen recording. But I imagine it would be easy for you to reproduce on your end.
... View more
07-05-2022
07:08 AM
|
0
|
1
|
2671
|
|
IDEA
|
Thanks @DuncanHornby and @KoryKramer. For our notes: If I understand correctly, it's possible to do it indirectly if we have a validation attribute rule on the table. But if we don't have a validation attribute rule, then there isn't a GP tool that can directly flag rows with invalid domain values.
... View more
07-05-2022
06:42 AM
|
0
|
0
|
958
|
|
IDEA
|
If I understand correctly, ArcGIS Pro stores blank M-values as negative infinity/NaN: --Oracle 18c SDE.ST_GEOMETRY EGDB select sde.st_m(sde.st_endpoint(shape)) as endpoint_m from my_line ENDPOINT_M ---------- -Infinity It seems weird to me that blank M-values would be stored as negative infinity/NaN. It wouldn't occur to me to query for negative infinity/NaN using SQL. I would query for null, since null means unknown or missing. Could that behavior be changed, so that blank M-values are stored as null? Edited Aug 16, 2023 Related: Documentation about empty strings, nulls, and NaN in ArcGIS Make it possible to store NaN values for Z values
... View more
07-04-2022
04:44 AM
|
1
|
3
|
1737
|
|
POST
|
What are some tips about nulls in SQL you can share? As GIS professionals, not SQL developers, it's easy to make mistakes when dealing with nulls in SQL. For example: We can't do math on nulls: 1 + NULL = NULL. Sometimes, people assume nulls will be automatically treated as zero. But that's not the case. We would need to explicitly convert nulls to something else (like zero) using COALESCE(), NVL(), etc.. NULL doesn't equal NULL. More specifically, null is neither equal to, nor is it not equal, to null. WHERE NULL = NULL won't return any results. Neither will WHERE NULL <> NULL. Further, be careful for cases like WHERE A <> B. Let's say A is 1 and B is null. That row won't get selected, because null is neither equal to, nor is it not equal, to anything. Joining on null values won't work either. Related: IS NOT DISTINCT FROM SQLite: Null-safe equals comparison using IS instead of =. Aggregate functions such as AVG() will ignore nulls. AVG(4,4,4,4,4,NULL) will evaluate to 4 (not 3.33). But be careful when doing math on the result of aggregate functions. Example: SUM(A) + SUM(B). Remember, we can't do math on nulls. So if the result of either of those aggregate functions is null, then the entire expression will evaluate to null. Different databases concatenate nulls differently. For example, in Oracle, nulls will be ignored in this concatenation: 'FOO ' || NULL || 'BAR' …will evaluate to… FOO BAR. But in other databases, that would result in NULL. Different databases treat empty strings differently. For example, in Oracle, SELECT '' FROM MY_TABLE will result in null. That's important to know for things like #1 above. We wouldn't want to replace NULL with '', since '' would simply result in null. With that said, putting a space ' ' between the single quotes would work; that won't get automatically converted to null. Are there any other gotchas or tips about nulls you can share? Or any improvements or corrections to the points above? Related: NULL in SQL: Indicating the Absence of Data Oracle Documentation - NULLS The Three-Valued Logic of SQL
... View more
07-02-2022
01:18 AM
|
0
|
2
|
5579
|
|
BLOG
|
On a side note: (I do a similar thing to what @jcarlson mentions above, but I use SQL queries in Oracle, instead of Arcade.) One thing I find frustrating is that domains don't have a date column/property to track the last time the domain was modified. Scenario — sync to external system: I have a sidewalk FC that I sync as assets to a work order management system. The sync logic is based on a SYNC_NEEDED column in a spatial view on the FC. That SYNC_NEEDED column is based on the LAST_EDITED_DATE. But ideally, It would also account for changes to domains as well. For example, the sidewalk FC has a MATERIAL column that uses a MATERIAL_SIDEWALK domain. If someone were to change a value in the domain from, say, CONCRETE to CONCRETE - CAST-IN-PLACE, then ideally, the affected features in the FC should be synced, so that the new material information would show up in the external system. But since there's no way to query for domains that have changed, that doesn't seem to be possible. The only other option for capturing the domain changes would be to re-sync the entire FC on a schedule, which is problematic since the external system (IBM Maximo) is extremely slow at syncing records. The only realistic option is to sync changes-only, not sync all rows. Related: Idea: Add a timestamp column to GDB_ITEMS table (Oracle) Auto-Updating features [flagging edited features for syncing to external system: Maximo]
... View more
07-01-2022
08:07 AM
|
2
|
0
|
424
|
|
POST
|
Oracle (with either SDE.ST_GEOMETRY or SDO_GEOMETRY FCs in mind): What are the options for storing additional shape information in a feature class? With single-part point information, we can simply create X and Y numeric columns. But what about lines, polygons, and multi-part points? Since having multiple geometry columns in a FC isn't supported, what datatypes would be suitable for storing additional shape information columns? (The idea being, ArcGIS would ignore any datatypes it doesn't recognize, which isn't the case for true geometry columns; they cause known issues in ArcGIS — i.e. versioning.) Some hypothetical ideas that come to mind (I could populate the columns via a trigger or, in some cases, attribute rules(?)): SDO_GEOMETRY_ARRAY MDSYS.VERTEX_SET_TYPE Nested table column OdciVarchar2List (varray) A custom user-defined object type SDO_ORDINATE_ARRAY (convert to text?) WKT in a text column JSON in a text column (or in a true JSON column) JSON, not GeoJSON, since the GeoJSON standard doesn't support M-enabled features. Note: Storing text-based formats like WKT or JSON would work. But from testing, converting from WKT or JSON to SDO_GEOMETRY is a bit slower than I'd like. Even more so for converting WKT to SDE.ST_GEOMETRY. I'm aware that there are alternatives like creating a separate/parallel FC to store additional true geometries. That would work, but the downside is that it requires adding dozens of new FCs to an already cluttered geodatabase. I want to explore what the alternative options are — as a learning exercise/experiment. Related: ArcGIS should ignore non-FC columns Event layers for lines, polygons, and multi-part points (via WKT) Event layers/query layers: Control caching settings for better performance ST_GEOMETRY FC: Options for using Oracle Spatial functions
... View more
07-01-2022
07:37 AM
|
0
|
0
|
978
|
|
POST
|
Why does the search bar in the search page obscure my profile picklist?
... View more
07-01-2022
07:21 AM
|
0
|
9
|
2716
|
|
POST
|
What is the purpose of the grey spacing in blog post comments? Examples: https://community.esri.com/t5/arcgis-pro-documents/arcgis-pro-roadmap-june-2022/tac-p/1187579/highlight/true#M285 https://community.esri.com/t5/arcgis-pro-blog/transformation-warning-what-does-it-mean-and-what/bc-p/1082862/highlight/true#M360 Thanks.
... View more
07-01-2022
06:16 AM
|
1
|
5
|
2069
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-20-2026 02:12 PM | |
| 1 | 03-19-2026 11:42 AM | |
| 1 | 06-03-2026 04:02 AM | |
| 1 | 03-18-2026 07:08 PM | |
| 2 | 2 weeks ago |