Boolean spatial predicates like ST_Intersects and ST_Contains are significantly faster than spatial overlay operations like ST_Intersection. When clipping geometries within a boundary, you can optimize performance by using a CASE statement to separate fully contained features (which don't need clipping) from boundary-crossing
Table of contents
Using CASE statement to combine predicates and overlaysSort: