Re: [PERFORM] Auto generate number in Postgres-9.1.

2017-03-20 Thread Andreas Karlsson
On 03/20/2017 03:08 PM, Dinesh Chandra 12108 wrote: But on deletion it's not automatically re-adjusting the id's. Do I need to create trigger for this?? It is possible to do but I advice against adjusting the IDs on DELETE due to to do so safely would require locking the entire table in the

Re: [PERFORM] Auto generate number in Postgres-9.1.

2017-03-20 Thread Andreas Karlsson
On 03/20/2017 02:43 PM, Josh Berkus wrote: If I truncate the same table and then again insert rows should start with 1 in “ID” column. That's not how it works, normally. I'd suggest adding an ON TRUNCATE trigger to the table. Actually that may not be necessary as long as you make sure to

Re: [PERFORM] Any advice tuning this query ?

2016-11-11 Thread Andreas Karlsson
I have a couple of suggestions which should lead to some minor improvements, but in general I am surprised by the huge size of the result set. Is your goal really to get a 43 million row result? When a query returns that many rows usually all possible query plans are more or less bad. 1) You

Re: [PERFORM] Does fsync on/off for wal AND Checkpoint?

2013-12-27 Thread Andreas Karlsson
there is a wal_sync_method but not a checkpoint_sync_method. The setting is for all uses of fsync within the PostgreSQL server, so if you turn it off PostgreSQL should never issue fsync. The only exceptions are some utility tools (eg. pg_basebackup) which do not read the configuration file. -- Andreas Karlsson

Re: [PERFORM] Problem with slow query with WHERE conditions with OR clause on primary keys

2013-12-18 Thread Andreas Karlsson
will realize that it can replace g.id_gd with gd.id_gd in the where clause. select g.gd_index, gd.full_name from gd g join gd_data gd on (g.id_gd = gd.id_gd) where gd.id_gd_data = OR gd.id_gd = ; -- Andreas Karlsson -- Sent via pgsql-performance mailing list (pgsql-performance