Re: [GENERAL] INSERT - UPDATE throughput oscillating and SSD activity after stopping the client

2016-12-06 Thread Tom DalPozzo
Hi, I did: pkill -x postgres so it should send SIGTERM. Regards Pupillo ​​

Re: [GENERAL] INSERT - UPDATE throughput oscillating and SSD activity after stopping the client

2016-12-06 Thread Jeff Janes
On Tue, Dec 6, 2016 at 2:44 AM, Tom DalPozzo wrote: > Hi, > about SSD light: > > I guessed it was WAL -> actual db files data traffic. It explains why the > light stops blinking after shutting down the server (I did it via kill > command) . > Do you kill with -15 (the default) or -9? And whic

Re: [GENERAL] INSERT - UPDATE throughput oscillating and SSD activity after stopping the client

2016-12-06 Thread Tom DalPozzo
Hi, about SSD light: I guessed it was WAL -> actual db files data traffic. It explains why the light stops blinking after shutting down the server (I did it via kill command) . But if so, I expected the light to restart blinking after restarting the server (in order to continue WAL->db activity). R

Re: [GENERAL] INSERT - UPDATE throughput oscillating and SSD activity after stopping the client

2016-12-05 Thread Jeff Janes
On Fri, Dec 2, 2016 at 9:40 AM, Tom DalPozzo wrote: > Hi, > I've two tables, t1 and t2, both with one bigint id indexed field and one > 256 char data field; t1 has always got 1 row, while t2 is increasing as > explained in the following. > > My pqlib client countinously updates one row in t1

Re: [GENERAL] INSERT - UPDATE throughput oscillating and SSD activity after stopping the client

2016-12-05 Thread Tom DalPozzo
I tried to tune some parameters without appreciable changes in this behaviour. I tried to play with: checkpoint timeout wal size shared buffers commit delay checkpoijnt completion target No meaningful info found in the log file. Regards 2016-12-04 4:02 GMT+01:00 Tomas Vondra : > On Fri, 2016-

Re: [GENERAL] INSERT - UPDATE throughput oscillating and SSD activity after stopping the client

2016-12-03 Thread Tomas Vondra
On Fri, 2016-12-02 at 13:45 -0800, Adrian Klaver wrote: > > On 12/02/2016 09:40 AM, Tom DalPozzo wrote: > > > > > > Hi, > > I've two tables, t1 and t2, both with one bigint id indexed field > > and > > one 256 char data field; t1 has always got 1 row, while t2 is > > increasing as explained

Re: [GENERAL] INSERT - UPDATE throughput oscillating and SSD activity after stopping the client

2016-12-02 Thread Adrian Klaver
On 12/02/2016 09:40 AM, Tom DalPozzo wrote: Hi, I've two tables, t1 and t2, both with one bigint id indexed field and one 256 char data field; t1 has always got 1 row, while t2 is increasing as explained in the following. My pqlib client countinously updates one row in t1 (every time target

[GENERAL] INSERT - UPDATE throughput oscillating and SSD activity after stopping the client

2016-12-02 Thread Tom DalPozzo
Hi, I've two tables, t1 and t2, both with one bigint id indexed field and one 256 char data field; t1 has always got 1 row, while t2 is increasing as explained in the following. My pqlib client countinously updates one row in t1 (every time targeting a different row) and inserts a new row in

Re: [GENERAL] INSERT/UPDATE statements sometimes choosing not to use PK index?

2013-10-29 Thread Matt
Since this is an upsert, the staging table simply accepts a copy of pipe-delimited data via a COPY FROM STDIN, and a subsequent SQL script performs the UPDATE/INSERT. The staging table is then truncated (or delete without where) for the next run: Truncate staging, COPY into staging, update then ins

Re: [GENERAL] INSERT/UPDATE statements sometimes choosing not to use PK index?

2013-10-29 Thread Tom Lane
Matt writes: > In most cases, EXPLAIN and runtime tell me the index is utilized. However, > sometime on back to back runs (5 minute intervals) the runtime explodes and > EXPLAIN shows me that the PK index is not used, as both the staging table > and destination table a sequentially scanned. You h

[GENERAL] INSERT/UPDATE statements sometimes choosing not to use PK index?

2013-10-28 Thread Matt
I have a relatively simple data load script, which upserts (UPDATE existing rows, INSERT new rows), which should be supported by the primary key index, the only index on this table: UPDATE destination SET ... FROM staging WHERE staging.pk = destination.pk; INSERT INTO destination SELECT ..

[GENERAL] Insert/Update/Delete views with INSTEAD OF

2007-12-12 Thread Ben
Hi Does anyone have any recommendations on how to migrate Oracle's 'INSTEAD OF' triggers to PostgreSQL's 'INSTEAD OF' rules? What I would like to do are: - When there's an insert to the view, the rule would insert the data into many tables. - When there's an update, the rule would insert and upd

[GENERAL] Insert/Update to multiple tables with relations

2007-12-04 Thread Dave
Hi, I need help with designing a set of queries I am running with psql -f reports.sql I have a tb_master with report headers, tb_records table with it's own serial field and foreign key referencing an "id" of tb_master. The third tb_details table has two foreign keys referencing the "id"'s of

Re: [GENERAL] insert/update

2004-05-27 Thread Jeff Eckermann
--- Tom Allison <[EMAIL PROTECTED]> wrote: > Jeff Eckermann wrote: > > --- Tom Allison <[EMAIL PROTECTED]> wrote: > > > >>I seemed to remember being able to do this but I > >>can't find the docs. > >> > >>Can I run a sql query to insert new or update > >>existing rows in one query? > > So I have

Re: [GENERAL] insert/update

2004-05-26 Thread Greg Stark
Richard Huxton <[EMAIL PROTECTED]> writes: > Tom - you don't say precisely what you're trying to do, but I like to keep my > code simple by making sure there is always a row available. Or alternatively you could always try to insert the record with a count of 0 then increment. If the insert fail

Re: [GENERAL] insert/update

2004-05-26 Thread Jeff Eckermann
--- Tom Allison <[EMAIL PROTECTED]> wrote: > I seemed to remember being able to do this but I > can't find the docs. > > Can I run a sql query to insert new or update > existing rows in one query? > > Otherwise I have to run a select query to see if > it's there and then > another one to update/

Re: [GENERAL] insert/update

2004-05-26 Thread Richard Huxton
Paul Thomas wrote: On 26/05/2004 11:54 Tom Allison wrote: What I'm trying to do is create a counter for each key, insert a value of 1 or increment the value by 1 and then set another specific row (where key = $key) to always increment by 1. Use a sequence. Not sure it's going to help him here.

Re: [GENERAL] insert/update

2004-05-26 Thread Paul Thomas
On 26/05/2004 11:54 Tom Allison wrote: I seemed to remember being able to do this but I can't find the docs. Can I run a sql query to insert new or update existing rows in one query? Otherwise I have to run a select query to see if it's there and then another one to update/insert. What I'm trying

[GENERAL] insert/update

2004-05-26 Thread Tom Allison
I seemed to remember being able to do this but I can't find the docs. Can I run a sql query to insert new or update existing rows in one query? Otherwise I have to run a select query to see if it's there and then another one to update/insert. What I'm trying to do is create a counter for each key