Changes

Jump to: navigation, search

Optimizing views in pgSQL

1,164 bytes added, 13:07, 6 August 2014
no edit summary
=== Problematic WHERE clause example ===__NOEDITSECTION__
In Afghanistan, there is a <pre>SELECT districtfree_view_hazardclosed.Region, districtfree_view_hazardclosed.Province, districtfree_view_hazardclosed.District, districtfree_view_hazardclosed.district_guid, Max(districtfree_view_hazardclosed.StatusChangedDate) AS [Last Hazard Closed]FROM districtfree_view_hazardclosedWHERE (((districtfree_view_hazardclosed.Status)="Expired"))GROUP BY districtfree_view_hazardclosed.Region, districtfree_view_hazardclosed.Province, districtfree_view_hazardclosed.District, districtfree_view_hazardclosed.district_guid;</pre><pre>SELECT districtfree_view_hazardclosed.Region, districtfree_view_hazardclosed.Province, districtfree_view_hazardclosed.District, districtfree_view_hazardclosed.district_guid, Max(districtfree_view_hazardclosed.StatusChangedDate) AS [Last Hazard Closed]FROM districtfree_view_hazardclosedWHERE (((districtfree_view_hazardclosed.Status) <> "Active" AND (districtfree_view_hazardclosed.Status) <>"Transitional"))GROUP BY districtfree_view_hazardclosed.Region, districtfree_view_hazardclosed.Province, districtfree_view_hazardclosed.District, districtfree_view_hazardclosed.district_guid;</pre>
== Summary of recommendations ==__NOEDITSECTION__
1,068
edits

Navigation menu