This presentation will demonstrate ways to take most advantage of spatial indexes, SQL constructs, and PostGIS specific functions. For these exercises we'll be using PostGIS 2.1+ and PostgreSQL 9.3+ . We'll demonstrate common cases people often do inefficiently.
This presentation demonstrates the following
1) Various SQL constructs including ANTI join, LEFT, RIGHT, EXISTS, LATERAL, CASE clauses, aggregates
2) What common table expressions (CTEs) are and when to and when not to use them
3) We'll demonstrate these concepts in use in a couple of common spatial query problems - e.g. proximity analysis (both geometry and geography), raster analysis and generation, aggregation of data based on various attributes, other correlation queries.