Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fyNil-0001QV-Sh for pgsql-performance@arkaria.postgresql.org; Fri, 07 Sep 2018 20:51:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fyNik-0001Vy-Fp for pgsql-performance@arkaria.postgresql.org; Fri, 07 Sep 2018 20:51:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fyKB2-0006Ej-5j for pgsql-performance@lists.postgresql.org; Fri, 07 Sep 2018 17:04:12 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fyKAu-00081z-Gz for pgsql-performance@postgresql.org; Fri, 07 Sep 2018 17:04:11 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 5DC92F0333C3 for ; Fri, 7 Sep 2018 10:04:02 -0700 (MST) Date: Fri, 7 Sep 2018 10:04:02 -0700 (MST) From: padusuma To: pgsql-performance@postgresql.org Message-ID: <1536339842382-0.post@n3.nabble.com> Subject: Performance of INSERT into temporary tables using psqlODBC driver MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I am working on adding support for PostgreSQL database for our application. In a lot of our use-cases, data is inserted into temporary tables using INSERT INTO statements with bind parameters, and subsequently queries are run by joining to these temp tables. Following is some of the data for these INSERT statements: Table definition: CREATE TEMPORARY TABLE Table1( auid varchar(15) ) ON COMMIT DELETE ROWS; SQL statement: INSERT INTO Table1 (uidcol) VALUES (:1); Time taken to insert 24428 rows: 10.077 sec Time taken to insert 32512 rows: 16.026 sec Time taken to insert 32512 rows: 15.821 sec Time taken to insert 6107 rows: 1.514 sec I am looking for suggestions to improve the performance of these INSERT statements into temporary tables. Database is located on a Linux VM and the version is "PostgreSQL 10.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18), 64-bit". The application is running on a windows platform and connecting to the database using psqlODBC driver version 10.03. Please let me know if any additional information is needed. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-performance-f2050081.html