| | 261 | * http://www.revsys.com/writings/postgresql-performance.html |
| | 262 | * http://www.depesz.com/index.php/2008/11/23/waiting-for-84-auto-explain/ |
| | 263 | |
| | 264 | Log all queries which take longer than 5s: |
| | 265 | {{{ |
| | 266 | su postgres |
| | 267 | psql |
| | 268 | set log_min_duration_statement = 5000; |
| | 269 | \q |
| | 270 | |
| | 271 | tail -n 45 -f /var/log/postgresql/postgresql-8.4-main.log |
| | 272 | }}} |
| | 273 | |
| | 274 | Disable logging again: |
| | 275 | {{{ |
| | 276 | su postgres |
| | 277 | psql |
| | 278 | set log_min_duration_statement = -1; |
| | 279 | \q |
| | 280 | }}} |
| | 281 | |
| | 282 | Log all queries which take longer than 5s & do an 'EXPLAIN' on those queries (not working) |
| | 283 | {{{ |
| | 284 | LOAD 'auto_explain'; |
| | 285 | set explain.log_min_duration = 5000; |
| | 286 | }}} |