Let Postgres Do the Work (2013)
This is an example of what I call &quot;embracing PostgreSQL&quot;. Roughly speaking it means ditching the ORM layers and using a simple API to run any SQL query that you can think up. Then your application can leverage the many features that exist in PostgreSQL and not just treat it as a dumb SQL server.<p>Using functions as an intermediary to raw queries, also decouples the SQL details from the application. What I mean is that if the application calls an SQL function to read, update, insert data then you can revise the SQL functions independently of application code. In other words, if you refactor an SQL function, you can deploy the change to the database without rebuilding and deploying the application.<p>This is especially helpful in companies that have an onerous verification and validation process for application changes, because often &quot;performance improvements&quot; are classified as administrative changes which can be done with less bureaucracy.<p>So, embrace PostgreSQL as a permanent part of your application and reap the benefits of its many powerful features.