Subject: [postgresql-interfaces/psqlodbc] issue #88: Poor performance of psqlodbc while executing ODBC array operations from TPCC load

From: "abhi-555 (@abhi-555)" <[email-masked]>
Date: Mon, 27 Jan 2025 10:37:23 +0000

We are trying to use psqlodbc to perform ODBC batch/array operations (the operations include a mix of insert, update and delete) using the standard benchmark Tpcc load. 

We are seeing a rate of 12000 records/sec getting processed, which is a very poor number. Is there any known connection option which needs to be set OR any other way which can help us speed this performance ?

Please let me know

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Sat, 01 Feb 2025 17:11:28 +0000

Without knowing the exact code this is difficult to answer.

---

From: "abhi-555 (@abhi-555)" <[email-masked]>
Date: Mon, 10 Feb 2025 15:11:57 +0000

[Standalones.zip](https://github.com/user-attachments/files/18735771/Standalones.zip)

I have attached a standalone for batch_insert and batch_update in Standalones.zip . We are using these to detect the time taken and rate of records processed during batch insert and update simultaneously. The DDL of the table used is present in the CPP files.

We have the below summary where we have performed a comparison between the psqlodbc driver and a third party postgres driver. We are seeing significantly lower rates of processing in batch insert and update using psqlodbc driver. 

Summary of comparison

Records per batch 10000
Number of batches 1

Insert Rates
psqlodbc driver : 46190.0 records/sec
third party postgres driver : 163041.5 records/sec

Update Rates
psqlodbc driver : 26060.5 records/sec
third party postgres driver : 59786.5 records/sec

Would request you to provide us some fix which can help improve this performance

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Mon, 10 Feb 2025 16:35:22 +0000

I'd be curious to see the server logs for each. I don't need all the logs, just a small sample of the inserts.

Thanks,
Dave

---

From: "abhi-555 (@abhi-555)" <[email-masked]>
Date: Thu, 13 Feb 2025 10:45:17 +0000

[ServerLogComparison.zip](https://github.com/user-attachments/files/18782517/ServerLogComparison.zip)

I have provided the server logs for 100 inserts in both the drivers - psqlodbc and the third party postgres driver. Please find the details in the attached zip.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Mon, 17 Feb 2025 18:23:39 +0000

OK, I can see the difference, thanks!

---

From: "abhi-555 (@abhi-555)" <[email-masked]>
Date: Thu, 20 Feb 2025 09:39:01 +0000

Could you please triage this issue and let us know when can we expect some fix on this?

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Sun, 23 Feb 2025 11:08:47 +0000

I'm still trying to figure out why https://github.com/postgresql-interfaces/psqlodbc/issues/92 fails, but in the meantime you could provide a PR for this one.

---

From: "abhi-555 (@abhi-555)" <[email-masked]>
Date: Mon, 21 Apr 2025 09:58:34 +0000

Hi Dave, 
Could you please provide us some info on this, as to when can we expect some fix here?

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Tue, 22 Apr 2025 13:36:29 +0000

I don't have any plans currently to work on this. If you wish to provide a Pull Request I would be happy to review it.