pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Slow while inserting and retrieval (compared to SQL Server)
Date: Wed, 17 Feb 2021 16:24:29 +0100
Message-ID: <408d6c93-1d7a-bbcd-a41b-3d0efb2d757d@gmx.net> (raw)
In-Reply-To: <1566185888.2096515.1613568453936@mail.yahoo.com>
References: <1671732859.1031650.1613563275311.ref@mail.yahoo.com>
	<1671732859.1031650.1613563275311@mail.yahoo.com>
	<951d8c4c-369d-63b3-f323-83660d96276f@gmx.net>
	<1566185888.2096515.1613568453936@mail.yahoo.com>

sivapostgres@yahoo.com schrieb am 17.02.2021 um 14:27:
> We use datawindows.  Datawindows will send the required DML
> statements to the database.
> And it sent in format 1 <single row update>.
>
> IN start of the application, Autocommit set to True.
> Before update of any table(s)
> Autocommit is set to False
> Insert/Update/Delete records
> If success commit else rollback
> Autocommit is set to True
>
> This has been followed for decades and it's working fine with Sql
> server.
>
> Here we are trying to insert just 10 records spread across 6 tables,
> which is taking more time.. that's what we feel.   The similar work
> in SQL Server takes much less time < as if no wait is there >.
>

The rollback can't work if autocommit is set to true.
Did you mean "IN start of the application, Autocommit set to FALSE"?

However these simple statements shouldn't take substantially longer
on Postgres than on SQL Server.

If you are DELETEing from tables with foreign keys: are all FK columns indexed?
That can make a huge difference if you delete from the parent table,
but the FK columns on the children aren't indexed.

It would be really interesting to see the execution plans generated
"explain (analyze)" for the DELETE and UPDATE statements.

ATTENTION: explain (analyze) actually runs that statement so it will do the
deletes or updates. Make sure you run that in a transaction so you can rollback.

Thomas





view thread (12+ messages)  latest in thread

Message-ID: <408d6c93-1d7a-bbcd-a41b-3d0efb2d757d@gmx.net>
Permalink:  ../408d6c93-1d7a-bbcd-a41b-3d0efb2d757d@gmx.net/
Also on:    postgresql.org/message-id/408d6c93-1d7a-bbcd-a41b-3d0efb2d757d@gmx.net

 · 

reply

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: shammat@gmx.net
  Subject: Re: Slow while inserting and retrieval (compared to SQL Server)
  In-Reply-To: <408d6c93-1d7a-bbcd-a41b-3d0efb2d757d@gmx.net>
  References: <1671732859.1031650.1613563275311.ref@mail.yahoo.com> <1671732859.1031650.1613563275311@mail.yahoo.com> <951d8c4c-369d-63b3-f323-83660d96276f@gmx.net> <1566185888.2096515.1613568453936@mail.yahoo.com> <408d6c93-1d7a-bbcd-a41b-3d0efb2d757d@gmx.net>

* 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