On Sun, 19 Mar 2000, martin wrote:

> Hi there, I have been doing some performance testing with ODBC and have
> found that
> ODBC is much slower than using C to call the Psql API
> I don't understand why the results are like this, I thought ODBC would
> slow things down a bit but not my much, all its doing in sending off SQL
> straight the server?
> 
> Test
> 
> Server: 486 50mhz, 16 mb Ram
> Client: P266, 32 mb Ram
> SQL: 1000 INSERT INTO's with quite a lot of fields. Read from a text
> input file
> 
> ODBC Test
> Windows 98 running VB6 and the freeware ODBC driver (I forget the name)
> Using TCP/IP network.
> The VB program will do about 30 records per minute.
> 
> C Test
> Linux C program, reads input file, calls API's. Run on Client PC so
> still communicates over the network.
> This setup will do 340 record per minute
> 
> My only guess is that the following bottlenecks are in the system:
> VB6 code that reads the text file - unlikely, it run's very quick if you
> remove the db.Execute call.
> ODBC parsing, maybe
> Something crappy about Windows, more likely

ODBC sucks on its own, but I'd bet the difference is that you open a
transaction for insert in Linux and don't do that in Windows (how do you
open a transaction in ODBC?). Difference is usually about 1:10 when you do
inserts in transaction, and server doesn't have to fsync after each
insert...


-alex

Reply via email to