Re: Degraded performance during table rewrite

2020-07-03 Thread Mohamed Wael Khobalatte
> > Another idea that might conceivably be useful to you on 9.6 is to reorganize the bulk deletions so that most of them aren't at the endpoint > of the live id range. If you made it so that the extremal values are > deleted last, you'd never hit this behavior. > > regard

Re: Degraded performance during table rewrite

2020-07-03 Thread Tom Lane
Mohamed Wael Khobalatte writes: > Do you happen to know if there is an upper limit to how much time the > planner is willing to spend on this? There is not. (I have considered that idea, but it's not implemented. I'm not sure whether there's still much practical problem given the v11+ behavior,

Re: Degraded performance during table rewrite

2020-07-03 Thread Mohamed Wael Khobalatte
On Fri, Jul 3, 2020 at 10:16 PM Mohamed Wael Khobalatte < mkhobala...@grubhub.com> wrote: > > On Fri, Jul 3, 2020 at 5:26 PM Tom Lane wrote: > >> Mohamed Wael Khobalatte writes: >> > ... the migration itself runs as follows (each in a transaction, looping >> > through records and sleeping for a

Re: Degraded performance during table rewrite

2020-07-03 Thread Mohamed Wael Khobalatte
On Fri, Jul 3, 2020 at 5:26 PM Tom Lane wrote: > Mohamed Wael Khobalatte writes: > > ... the migration itself runs as follows (each in a transaction, looping > > through records and sleeping for a bit) > > > WITH del AS ( > > DELETE FROM #{old_table} > > WHERE id IN ( > > SELECT id > >

Re: Degraded performance during table rewrite

2020-07-03 Thread Ron
On 7/3/20 3:24 PM, Mohamed Wael Khobalatte wrote: Hi all, I am attempting to do a bunch of table rewrites to shrink a table in the absence of pg_repack and vacuum full (both not an option). The database is growing fast and has had significant bloat in both heaps and indexes, so index rebuilds

Re: Degraded performance during table rewrite

2020-07-03 Thread Tom Lane
Mohamed Wael Khobalatte writes: > ... the migration itself runs as follows (each in a transaction, looping > through records and sleeping for a bit) > WITH del AS ( > DELETE FROM #{old_table} > WHERE id IN ( > SELECT id > FROM #{old_table} > WHERE id > #{max_deleted_id} -- This is

Re: Degraded performance during table rewrite

2020-07-03 Thread Mohamed Wael Khobalatte
On Fri, Jul 3, 2020 at 4:24 PM Mohamed Wael Khobalatte < mkhobala...@grubhub.com> wrote: > Hi all, > > I am attempting to do a bunch of table rewrites to shrink a table in the > absence of pg_repack and vacuum full (both not an option). The database is > growing fast and has had significant bloat

Degraded performance during table rewrite

2020-07-03 Thread Mohamed Wael Khobalatte
Hi all, I am attempting to do a bunch of table rewrites to shrink a table in the absence of pg_repack and vacuum full (both not an option). The database is growing fast and has had significant bloat in both heaps and indexes, so index rebuilds alone won't cut it. We found that table inheritance ca

Re: survey: psql syntax errors abort my transactions

2020-07-03 Thread Julien Rouhaud
On Fri, Jul 3, 2020 at 7:46 PM Ron wrote: > > On 7/3/20 1:54 AM, Laurenz Albe wrote: > > This is my favorite example why I like the way PostgreSQL does things: > > > > /* poor man's VACUUM (FULL) */ > > BEGIN; > > CREATTE TABLE t2 AS SELECT * FROM t1; > > DROP TABLE t1; > > ALTER TABLE t2 RENAME T

Re: survey: psql syntax errors abort my transactions

2020-07-03 Thread Ron
On 7/3/20 1:54 AM, Laurenz Albe wrote: On Thu, 2020-07-02 at 08:54 -0700, Jeremy Schneider wrote: Maybe it's just me, but I'm wondering if it's worth changing the default behavior of psql so it doesn't abort transactions in interactive mode when I mistakenly mis-spell "select" or something sill

Re: Unable to run psql on 9.5 after broken 12 remove

2020-07-03 Thread Adrian Klaver
On 7/3/20 8:15 AM, Moreno Andreo wrote: Il 03/07/2020 16:51, Adrian Klaver ha scritto: On 7/3/20 1:54 AM, Moreno Andreo wrote: Looks like the cluster was not removed from the pgcommon setup. This would explain why you can't run psql. By default pgcommon looks for the version of psql connected

Re: Unable to run psql on 9.5 after broken 12 remove

2020-07-03 Thread Moreno Andreo
Il 03/07/2020 16:51, Adrian Klaver ha scritto: On 7/3/20 1:54 AM, Moreno Andreo wrote: Looks like the cluster was not removed from the pgcommon setup. This would explain why you can't run psql. By default pgcommon looks for the version of psql connected with the most recent version of Postgres

Re: [HELP] Regarding how to install libraries

2020-07-03 Thread Adrian Klaver
On 7/3/20 7:21 AM, Adrian Klaver wrote: On 7/3/20 4:37 AM, Praveen Kumar K S wrote: Hello, PostgreSQL libraries are required while compiling pgpool. I need to install postgresql-libs and postgresql-devel on Ubuntu Server 16.04 Why not install pgpool from package? Assuming using PGDG repo:

Re: Unable to run psql on 9.5 after broken 12 remove

2020-07-03 Thread Adrian Klaver
On 7/3/20 1:54 AM, Moreno Andreo wrote: After upgrading python the InvalidUrl is gone, but I still can't run psql Output of pg_lsclusters, if needed root@datastore-1:/usr/share/postgresql-common# pg_lsclusters Ver Cluster Port Status    Owner Data directory   Log fil

Re: [HELP] Regarding how to install libraries

2020-07-03 Thread Adrian Klaver
On 7/3/20 4:37 AM, Praveen Kumar K S wrote: Hello, PostgreSQL libraries are required while compiling pgpool. I need to install postgresql-libs and postgresql-devel on Ubuntu Server 16.04 Why not install pgpool from package? Assuming using PGDG repo: sudo apt install postgresql-12-pgpool2

[HELP] Regarding how to install libraries

2020-07-03 Thread Praveen Kumar K S
Hello, PostgreSQL libraries are required while compiling pgpool. I need to install postgresql-libs and postgresql-devel on Ubuntu Server 16.04 How can I install only these packages without having to install the entire postgres server ? TIA. -- *Regards,* *K S Praveen Kumar*

Re: Unable to run psql on 9.5 after broken 12 remove

2020-07-03 Thread Moreno Andreo
After upgrading python the InvalidUrl is gone, but I still can't run psql Output of pg_lsclusters, if needed root@datastore-1:/usr/share/postgresql-common# pg_lsclusters Ver Cluster Port Status    Owner Data directory   Log file 9.5 main    6543 online   

Unable to run psql on 9.5 after broken 12 remove

2020-07-03 Thread Moreno Andreo
I have a production server running pg9.5 seamlessly. Yesterday I decided to install libpq to have some crypto functions. Unexpectedly, it installed postgresql 12 and its libpq. I don't need pg 12, so I decided to remove it. It did not went well root@datastore-1:/home/user# apt-get --purge remov