Re: [PERFORM] How to log quires which are taking time in PostgreSQL 9.1.

2017-02-23 Thread ProPAAS DBA
set log_min_duration_statement = 300,000 (300,000 ms = 5min) From the docs: log_min_duration_statement (integer) Causes the duration of each completed statement to be logged if the statement ran for at least the specified number of milliseconds. Setting this to zero prints all statement d

Re: [PERFORM] Sort-of replication for reporting purposes

2017-01-12 Thread ProPAAS DBA
On 01/06/2017 12:24 PM, Ivan Voras wrote: Hello, I'm investigating options for an environment which has about a dozen servers and several dozen databases on each, and they occasionally need to run huge reports which slow down other services. This is of course "legacy code". After some discu

Re: [PERFORM] why we do not create indexes on master

2016-12-27 Thread ProPAAS DBA
Possibly some buffer caching is happening, what happens if you then remove the added index and run the query again? On 12/27/2016 10:38 AM, Valerii Valeev wrote: Thank you David, I used same rationale to convince my colleague — it didn’t work :) Sort of “pragmatic” person who does what seems

Re: [PERFORM] How to vacuum entire database excluding some tables in PostgreSQL9.1.

2016-12-21 Thread ProPAAS DBA
Something like this in a bash script? #!/bin/bash echo "select schemaname, tablename from pg_tables where tablename not in (your list of excluded tables) and schemaname not in ('information_schema', 'pg_catalog')" | psql -t > /tmp/tablist exec < /tmp/tablist while read line do set - $l

[PERFORM] Isolation of tx logs on VMware

2016-12-13 Thread ProPAAS DBA
Hi All; We have a client running on VMware, they have heavy write traffic and we want to isolate the IO for the tx logs (pg_xlog). However it seems the best plan based on feedback from the client is either (a) simply leave the pg_xlog dir in the VMDK or (b) relocate pg_xlog to NAS/NFS I'