X-Original-To: pgsql-odbc@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C08C9475CB4 for ; Thu, 13 Feb 2003 14:49:35 -0500 (EST) Received: from unirea.ro (unknown [194.102.93.158]) by postgresql.org (Postfix) with ESMTP id 1FF96475E10 for ; Thu, 13 Feb 2003 14:49:16 -0500 (EST) Received: from informatica (marius.cen.bcu.ro [110.39.0.17]) by unirea.ro (8.9.3/8.9.0) with ESMTP id XAA01391 for ; Thu, 13 Feb 2003 23:01:17 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2; format=flowed To: pgsql-odbc@postgresql.org Subject: slowness in fetch from the psqlodbc driver From: Ionut Giurea Organization: BCU Date: Thu, 13 Feb 2003 21:40:25 +0200 Message-ID: User-Agent: Opera7.01/Win32 M2 build 2651 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/64 X-Sequence-Number: 2682 Hi, I am using PsqlODBC 7.2.5 and Postgres 7.2.2. While trying to run a Delphi 3 application using BDE I noticed some important differences in comparison to an MS Sql database in selecting multiple rows from a database. This can be noticed even in borland's database explorer when running a select * from large_table and displaying the results in a grid table. I looked at the traffic between the computer and the database usgina tcp/ip packet sniffer and the response I got from the MS SQL and Postgres SQL server are quite similiar as traffic and speed, BUT there are two differences: 1. In the postgres case, all the respone records are fetched from the database server by the odbc driver,while in the MS SQL case, not all the response records are transferred, only a part, and the rest are transferred when I move down in the application's grid table. This difference is not so important from the user's point of view, he didn't even notices it, it might became semnificative for very large tables when the traffic between the application and the database server is big. 2. The fetch from the odbc works much,much slower in the postgresodbc driver than in the mssql driver. When I try a locate or a recordcount function in the query table from the Delphi application, they are making a fetch_all from the odbc driver so I don't see any traffic between the station and the Postgres database server, I notice fetching the remaining rows from the MS SQL Server as I explained before, but this Fetch_All operation takes about half a second in the MS SQL case and 8 seconds in the Postgres case for a 2000 rows query. So I made a simple application with a query, a datasource anda grid table. The application performs a {query.close; query.open;query.recordcount} While looking at the tcp/ip sniffer in these 2 cases I saw that the traffic is the same and at the same speed, but while in the mssql case the grid is filled up almost immediately the tcp/ip traffic stops, in the Postgres case it takes many seconds until the results are displayed. Both cases are using bde with odbc drivers so the problem must be in postgres's odbc driver. Can this be speeded up? All the best, Ionut