From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Souvik Bhattacherjee <kivuosb@gmail.com>
Cc: Rob Sargent <robjsargent@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Running concurrent txns and measuring the timings in Postgres
Date: Wed, 24 Jul 2019 14:11:20 -0700
Message-ID: <77a9686c-4d6d-e964-019f-1966224ae803@aklaver.com> (raw)
In-Reply-To: <CAANrPSedihfvOoba7qkrdqjwZaQr-JtB=VQE=WmODbtqiX_U6g@mail.gmail.com>
References: <CAANrPSeXewRj2NehjMog-=zuYUbfz677iUOV1j-Gzm94XcJ9Lg@mail.gmail.com>
<160cb824-6952-d468-9a6b-3b7474348d5a@aklaver.com>
<CAANrPSckb71-5L-vCpVMHr1mqmDQhzgODj0WZL0B+ZZW+-dHxA@mail.gmail.com>
<dadaea1c-fe49-5323-068f-7cd572a9af14@aklaver.com>
<CAANrPSfT9MVELJPomuggtcg8+KrLcRv2qAi-46figornSbUxsQ@mail.gmail.com>
<e8eacebb-aaf6-dd5b-cb3a-f5421a069df8@aklaver.com>
<CAANrPSedihfvOoba7qkrdqjwZaQr-JtB=VQE=WmODbtqiX_U6g@mail.gmail.com>
On 7/24/19 1:52 PM, Souvik Bhattacherjee wrote:
> >Well it depends on the part you have not filled in, what client(s) you
> > are using and how the transactions are being generated?
>
> Using a psql client and txns are generated manually at this point. Each
> txn is
> stored separately in a .sql file and are fired from different psql
> sessions, if that
> helps.
>
A quick demo:
psql -d production -U postgres -c "\timing" -c "select line_id, category
from avail_headers order by line_id;"
Timing is on.
Time: 0.710 ms
> On Wed, Jul 24, 2019 at 4:44 PM Adrian Klaver <adrian.klaver@aklaver.com
> <mailto:adrian.klaver@aklaver.com>> wrote:
>
> On 7/24/19 1:42 PM, Souvik Bhattacherjee wrote:
> > > The duplicate elimination is being handled by ON CONFLICT or
> some custom
> > > process in the code generating the transactions?
> >
> > Yes, we used ON CONFLICT for that. Thanks btw.
> >
> > > If the transactions are being created from a single app/script
> could you
> > > not just use 'timing' to mark the beginning of the
> transactions and the
> > > end and record that somewhere(db table and/or file)?
> >
> > So did you mean to say that I need to get the timestamps of the
> > beginning/end
> > of the txn since \timing only produces elapsed time? Surely that
> would
> > solve the
> > problem but I'm not sure how to get that done in Postgres.
> >
> > I wanted to check to see if there are simpler ways to get this
> done in
> > Postgres
> > before trying out something similar to Rob's suggestion or yours.
> >
>
> Well it depends on the part you have not filled in, what client(s) you
> are using and how the transactions are being generated?
>
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: adrian.klaver@aklaver.com, kivuosb@gmail.com, robjsargent@gmail.com
Subject: Re: Running concurrent txns and measuring the timings in Postgres
In-Reply-To: <77a9686c-4d6d-e964-019f-1966224ae803@aklaver.com>
References: <CAANrPSeXewRj2NehjMog-=zuYUbfz677iUOV1j-Gzm94XcJ9Lg@mail.gmail.com> <160cb824-6952-d468-9a6b-3b7474348d5a@aklaver.com> <CAANrPSckb71-5L-vCpVMHr1mqmDQhzgODj0WZL0B+ZZW+-dHxA@mail.gmail.com> <dadaea1c-fe49-5323-068f-7cd572a9af14@aklaver.com> <CAANrPSfT9MVELJPomuggtcg8+KrLcRv2qAi-46figornSbUxsQ@mail.gmail.com> <e8eacebb-aaf6-dd5b-cb3a-f5421a069df8@aklaver.com> <CAANrPSedihfvOoba7qkrdqjwZaQr-JtB=VQE=WmODbtqiX_U6g@mail.gmail.com> <77a9686c-4d6d-e964-019f-1966224ae803@aklaver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox