4

If a spatial view contains data "joined" from multiple tables, will all the tables be queried whenever a query is executed against the spatial view?

We have some spatial views and whenever we run a query against some of them, the query can take over an hour to run. We're talking about a basic "select * from xyz" query.

Update - We are not using versioning and the geometry is stored as st_geometry.

  • 1
    what RDBMS are you using, what spatial type are you using and is your data versioned? – Dowlers May 12 '16 at 16:48
  • A view is a cached query, but only the rule is cached, not the results. Full table scan query performance is all about join indexes (and optimizer hints, as necessary). – Vince May 12 '16 at 18:32
3

The short answer is yes. A view is basically a stored query.

A couple of general things you can try to speed up you database performance.

  1. Make sure all your join fields are indexed
  2. Make sure the database statistics are refreshed
  3. If you data is versioned are you using ESRI multi versioned views as part of you views?
  4. If your data is versioned make sure you run a compress and analyze regularly

Edit

  1. Also try dropping and recreating the spatial indexes on the geometry columns

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.