PostgreSQL create database statement takes longer than usual - postgresql

Creating a new empty database (using pgAdmin 4) usually takes 5-15 sec but recently it started to take much longer (2-3min).
When creating a new database I use a template (postgis) database. We have recently switched from postgresql 9 to 10.
Anticipating potential questions:
template database is empty (only template tables etc)
I did the VACUUM FULL
the database server (Win server 2012, Intel Xeon 3,2 Ghz 12 cores, 64GB RAM) is not very overloaded - on average: 7-10% CPU, 30-35% memory usage
Any hints what might be the reason? what elese should I check ?

Related

Upgraded RDS postgres from 11.16 to 14.4, CPU has been stuck at 100% for hours while running the huge aggregate queries

We have upgraded our AWS RDS Postgres from 11.16 to 14.4, After that I can see CPU stay around 100% for long hours while running the aggregate Queries.
I'm working with a large database. Most of the main tables have 1 million records. While running these aggregate queries in previous version (11.16) it will give the result without increasing the CPU usage.
Can we use ANALYZE command for optimizing the upgraded database?
Is there any impact when we running this command on database?
Any suggestions for resolving this?

Is it possible to increase Pgadmin4 speed?

I have installed Pgadmin 4 on a Windows 10 x64 system with 16gb of ram.
The problem is: if I send a simple query on a PostgresSql14 server, like extracting some data on a 10 rows table and i make a syntax error ( for example mispelling an attribute or a comma) the query sometimes runs forever and i can't even kill it.
If i do the same error in the cmd this get caught in milliseconds.
I have tried to modify the values in postgresql.conf with this values:
shared_buffers=4096MB
max_wal_size = 4GB
Furthermore sometimes the query runs for many minutes even if it's correct and the data accessed are few.
Is this behaviour normal for PgAdmin4?
If not how to fix it?

How to limit pg_dump's memory usage?

I have a ~140 GB postgreDB on Heroku / AWS. I want to create a dump of this on a windows Azure - Windows server 2012 R2 virtual machine, as i need to move the DB into Azure environment.
The DB has a couple of smaller tables, but mainly consists of a single table taking ~130 GB, including indexes. It has ~500 million rows.
I've tried to use pg_dump for this, with:
./pg_dump -Fc --no-acl --no-owner --host * --port 5432 -U * -d * > F:/051418.dump
I've tried on various Azure virtual machine sizes, including some fairly large with (D12_V2) 28GB ram, 4 VCPUs 12000 MAXIOPs, etc. But in all cases the pg_dump stalls completely due to memory swapping.
On above machine it's currently using all available memory and has used the past 12 hrs swapping memory on the disk. I dont expect it to complete, due to the swapping.
From other posts i've understood it could be an issue with the network speed, beeing much faster than the disk IO speed, causing pg_dump to suck up all available memory and more, so i've tried using the azure machine with most IOPs. This hasnt helped.
So is there another way i can force pg_dump to cap it's memory usage, or wait on pulling more data until it has written to disk and clear memory ?
Looking forward to your help!
Krgds.
Christian

Backup/Restore of Firebird SQL Server 3.0.2 is slow on Windows Server 2016

I have installed Firebird 3.0.2 SQL database on my Windows Server 2016. No other software has been installed yet.
I'm using Superserver mode and an SSD drive.
When I just copy my database file of size 6 GB, it is done in 20-30 seconds (same disk).
But when I execute backup it takes 20-30 minutes. Restore is about the same amount of time. Together 40-60 minutes.
And there is strange thing: backup/restore process (gbak.exe) does not use full power of CPUs and HDD. It is using only ~20% . I don't understand why.
I think it should be something in configuration right? But I kept everything in default values.
Very important thing: I am new in Windows Server 2016 so I have no idea what I am doing.
Any ideas?
I found out that it is about configuration of Power Options.
Windows Server 2016 is after installation set for Balanced Power Plan.
I changed it to High performance and results are highly better. (backup drops from 30 minutes to 6 minutes)
More details you can find here: https://serverfault.com/a/797473
To find the restore bottleneck in Firebird 3 you should add the detail protokoll option:
-v -stat TDRW Filename
-v (Verbose output of what GBAK is doing)
-stat (Runtime statistics in its verbose output)
T (Total time)
D (Total delta)
R (Page reads)
W (Page writes)
Have a look to the GBAK option
-service localhost:service_mgr
it is a speed demon :-)

Performace tuning of Postgres server

I have Postgres 9.1 installed on Windows server 2008 R2 machine having 32 GB RAM. For performance tuning i have to update the shared buffer to 8 GB. But after updating the shared buffer to 8 GB in postgresql.conf file i am not able to start the service. its giving error message "The Postgresql-9.1 - Postgresql server 9.1 serviceon local computer started and then stopped. Some servcies stop automatically if they are not in use by other servcies or programs".
Any one can suggest how can i update the shared buffer. your suggestions are highly appreciated...