X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 26A7211F6965 for ; Tue, 4 Apr 2006 07:45:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 45483-06 for ; Tue, 4 Apr 2006 07:45:14 -0300 (ADT) Received: from pgfoundry.org (pgfoundry.org [200.46.204.130]) by postgresql.org (Postfix) with ESMTP id 08EFF11F6960 for ; Tue, 4 Apr 2006 07:45:13 -0300 (ADT) Received: from localhost (av.hub.org [200.46.204.144]) by pgfoundry.org (Postfix) with ESMTP id 0D99C1033855; Tue, 4 Apr 2006 10:45:14 +0000 (GMT) Received: from pgfoundry.org ([200.46.204.130]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48281-02; Tue, 4 Apr 2006 07:45:12 -0300 (ADT) Received: by pgfoundry.org (Postfix, from userid 80) id 2A595103383D; Tue, 4 Apr 2006 10:45:12 +0000 (GMT) To: noreply@pgfoundry.org From: Subject: [ psqlodbc-Bugs-1000604 ] 8.01.0200 slow with long queries Content-type: text/plain; charset=UTF-8 Message-Id: <20060404104512.2A595103383D@pgfoundry.org> Date: Tue, 4 Apr 2006 10:45:12 +0000 (GMT) X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=-0.701 required=5 tests=[ALL_TRUSTED=-1.44, AWL=0.189, NO_REAL_NAME=0.55] X-Spam-Score: -0.701 X-Spam-Level: X-Archive-Number: 200604/17 X-Sequence-Number: 7544 Bugs item #1000604, was opened at 2006-04-04 13:45 You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000604&group_id=1000125 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Lasse Haataja (lhaataja) Assigned to: Nobody (None) Summary: 8.01.0200 slow with long queries Initial Comment: psqlodbc 8.01.0200 is much slower than 8.01.0102 (and earlier versions) with long (>10 kilobytes) queries; a 1 megabyte query that takes two seconds with .0102 takes 37 minutes with .0200. According to mylog, most of the time seems to be taken by PGAPI_NumParams. (Although bind.c seems to be identical in .0102 and .0200, perhaps the arguments the function is called with makes the difference?) The culprit seems likely to be the line for (i = 0; i < strlen(stmt->statement); i++) where strlen is (needlessly, since the string is not modified, let alone its length changed) evaluated once for each iteration of the loop, resulting in O(N^2) complexity. Fix should be easy, something along the lines of size_t stmt_len = strlen(stmt->statement); for (i = 0; i < stmt_len; i++) The same problem occurs in misc.c function remove_newlines(); the same fix appears applicable there as well. ---------------------------------------------------------------------- You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000604&group_id=1000125