X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id DC885D1CCDF for ; Fri, 30 Jan 2004 10:08:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 46188-01 for ; Fri, 30 Jan 2004 06:08:47 -0400 (AST) Received: from www.postgresql.com (www.postgresql.com [200.46.204.209]) by svr1.postgresql.org (Postfix) with ESMTP id 852EAD1CACF for ; Fri, 30 Jan 2004 06:08:44 -0400 (AST) Received: from frodo.hserus.net (frodo.hserus.net [204.74.68.40]) by www.postgresql.com (Postfix) with ESMTP id 02016CF4C0D for ; Fri, 30 Jan 2004 03:04:00 -0400 (AST) Received: from concord.pspl.co.in ([202.54.11.72]:64057 helo=frodo.hserus.net) by frodo.hserus.net with asmtp (Cipher TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.30 #0) id 1AmSh5-000A7R-EA by authid with plain for ; Fri, 30 Jan 2004 12:33:59 +0530 Message-ID: <401A01D1.9050504@frodo.hserus.net> Date: Fri, 30 Jan 2004 12:33:45 +0530 From: Shridhar Daithankar User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: On the performance of views References: <40152FF2.8000007@potentialtech.com> <4017764B.3080903@frodo.hserus.net> <4017DD0D.6040200@potentialtech.com> <200401291041.19017.josh@agliodbs.com> <40195B0E.3010903@potentialtech.com> In-Reply-To: <40195B0E.3010903@potentialtech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/324 X-Sequence-Number: 5498 Bill Moran wrote: > Basically, all I do is call each query in turn until I've collected all the > results, then marshall the results in to a SOAP XML response (using gsoap, > if anyone's curious) and give them back to the client application. It's > the client app's job to figure out what to do with them, not mine. I > never would have written it this way on my own, but the client app is > already written, so as I migrate it to the client-server model, the > programmers who wrote the client app are specifying what they expect me > to provide them. In C++/OO way, that would have been a array/list of base object pointers with virtual methods for - Obtaining result set - Making a soap/XML out of it - Deliver it - And pre/post processing And delegate the unique query/data handling to specific subclasses. Now that you are doing that in C, you can as well use function pointers to mimic inheritance and virtual functions. The only difference being a. No typechecking. A function pointer in C, won't crib if you pass it wrong number/wrong types of argument. C++ compiler will catch that. b. Maintainance is nightmare unless you thoroughly document it. In C++, glancing over source code might suffice. And no, in-source comment rarely suffice when you use C for such applications. I maintain such an application for day-job and I know what help/menace it can be at times..:-( But either way, asking for/using/maintaining non-homogeneous recordset is a classic three finger salute. Load the gun, point to head and shoot. Just a thought.. Shridhar