Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Does anyone know what will be the performance difference between publishing a spatial table directly vs. creating a view of the same table and publishing it in GeoServer?

Does the spatial index on a table still work on a view derived from it?

Thanks a lot!

share|improve this question
    
if you turn debuging on you should see the query in the log, then run explain on it in psql –  iant Jun 3 '13 at 7:52

2 Answers 2

up vote 3 down vote accepted

Views are just named queries stored into the database so they will use indexes on the underlying tables just as if you had run the query statement.

Depending on your postgres expertise it might be worthwhile reading the INDEX section of the postgres manual, expecially the part on expressions.

You can confirm that the view and the query are assigned the same execution plan by creating the view and then using the EXPLAIN command on the view and the query. The output should be identical.

share|improve this answer

In Oracle there is something called materialized view. This might be available in some next version of Postgre, but for now you can try a workaround.

If your data does not need to be updated frequently you can create a table that you fill in from results of a view query, and then refresh it periodically by scheduled job.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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