Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCOh0-0002y8-Fx for pgsql-general@arkaria.postgresql.org; Wed, 17 Feb 2021 15:24:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lCOgy-0003TX-Kt for pgsql-general@arkaria.postgresql.org; Wed, 17 Feb 2021 15:24:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCOgy-0003Qz-BT for pgsql-general@lists.postgresql.org; Wed, 17 Feb 2021 15:24:40 +0000 Received: from mout.gmx.net ([212.227.15.15]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lCOgr-0003sE-P7 for pgsql-general@lists.postgresql.org; Wed, 17 Feb 2021 15:24:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1613575470; bh=1YdNSeinAWiOqmcE6rB3sWSfeIslMfdHgwjxiblWh/w=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=b6uUI5VzqbQQlO1am0gPXg7qrB6Jd1yQpae4nW5lL/q8onKWyU1gB1znYJjfgZwTq hDwpF6ZpGkt7YQ12zNW9buJyXtOSx+oiircfTEJ0TUORJbeniWoeEzQY3wQa1rCNN+ haI4mr0q5KYYfIk69JDwXJEGThJRFhYImNhlXDUg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [10.1.35.226] ([185.40.248.10]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N6sn7-1lvviz204N-018KaU for ; Wed, 17 Feb 2021 16:24:30 +0100 Subject: Re: Slow while inserting and retrieval (compared to SQL Server) To: "pgsql-general@lists.postgresql.org" 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> From: Thomas Kellerer Message-ID: <408d6c93-1d7a-bbcd-a41b-3d0efb2d757d@gmx.net> Date: Wed, 17 Feb 2021 16:24:29 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <1566185888.2096515.1613568453936@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:tVRh0PkBlR3Tf+E6nIu/q0KbzCR9pry5/w2F1BjkxnIYqVnJVbT iwJqjraHG7EC4/tQm+aszdgrm/IpxZBvRJOQ8R6ikVau7Akgs69ooh06VEpU4EcIAOSy5o/ dKSOcA+dFUx8U5rwfqGs0eFQ2LhZyhi1b/0pHbCBhGon/rbPSCROyTgIRD2oIlpgwD/F62V JRRaJXquh7uj0NVZtYf4Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:sDaCyaUx0NY=:uShFCZtMg9WOZYgWut1ctv hma4lqpGXJVzzLRA1rye1ivMQbOcmm4W5qKDk6IfBhN4UWa+L7aDYevUaCN+sAp5xZsdpyQ0Q PzyNrEPOiwTEPy/bzClfDp5pCU+X8NoTNuAh3T8jfza74h947slNKT5UmV7iooA12jgp7L6lv iLRz2INafY1WCacOcprXfaoACJX/UqcE7reV5IBwm9fmJB1X7yocHHTTk+O8dcufAu13sQywk SJ2spsaTaxo1n4kUDvkNhMrknNRm+CCvsJNkDupzF79ZBeEKk79s2fbjzEqW8ydTb17f2IRsY xsjYVyM64KBJqtrsIESEXmwuvYGTs8wW1ep1pyW6CiFUXWf+xl2JfYMiNZrKdkeHdtdnos3q6 rdo6LfqtxzEzoHaTPIyVszg1BNqrZfW7POByF9jLx0pRBi58kiyGJC4cZ3fBHC/i++GDJqKA+ iLTJ4DNWT3WeZKMibyGeXMr1obQEQgtaUXdcSGKBqrmRQSHWgYOxkAFvsGpd8xMX7mXxsl8xX rR0hV/EW2gQB7k3VbKvO08tbv7yXJVOUujaHpMp2M69Bw6jYFJfl02Yncla5g06mK4ga1omCi WE7gLQZvR4htuMEhBM7MRQt5bv0lNbpQInrjWNd+Ys7SD/+F2bAW+RIi67EG2+4hdPeGsD0GL mFF/3iSdjrWe0QoY5beAk61ukffh4COQLRCcANq8IH7+J71mtJHpL/1KOva0krAZ6OVoxXg/Z L4u4A5wK+13o/4/EHLXZVqfGA9Fi5KHAgxSbKxAHzcKY1dHKDx9EUYGakOYqmFU3gXMLuiHuS O3YrbnsYw6qMu3Du2KgMUIvIdoJWQ1IkkFsOwqyBEpgfrvnLn4ZrYOuoZcBBb2G5X/CXIY7Zb 89B+YVFhomokTuOEessQ== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 . > > 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 ind= exed? 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 th= e deletes or updates. Make sure you run that in a transaction so you can rol= lback. Thomas