Re: Simplified (a-la [G|N]DBM) DB access

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Simplified (a-la [G|N]DBM) DB access
Date: 2005-04-20 13:39:18
Message-ID: 60pswp36ux.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Xlex0x835(at)rambler(dot)ru (Alexandre) writes:

> On Apr 19, 2005, at 23:24, Dan Sugalski wrote:
>
>> At 9:40 PM +0400 4/19/05, Alexandre wrote:
>>> Lane, thank you, but it is not: PostISAM "generates SQL statements
>>> on the fly from traditional ISAM (read, write, start) statements",
>>> so it just add overhead, and is not what I'm looking for.
>>
>> Speaking from experience, as I have a system which hides Postgres
>> behind an ISAM interface (though not PostISAM -- I rolled my own DB
>> library) as part of a legacy 4GL migration, the overhead's
>> ignorable. Dismissing it for that reason's not a good idea.
>
> Does your own ISAM interface also convert ISAM calls to the SQL
> queries? If so, then it is also add overhead: make a call to the some
> wrapper, which will generate SQL query and send it to the sever, which
> will parse, plan and compile it and execute only after
> that. Desirable: make a call, which will connect to the server and get
> row.

I think you're missing two points:

1. With careful design, the ISAM "wrapper" can _avoid_ most of the
costs you suggest.

For instance, one might set up a prepared query which would only
parse, plan, and compile the query _once_.

Further, I'd expect that most of the behaviour could be
hidden in stored procedures which would further hide the need to
parse, plan, and compile things. The ISAM-congruent abstraction
would presumably make it easier to use, to boot.

2. Dan Sugalski indicated that he actually found the overhead to be
ignorable.

As a datapoint, that's pretty useful. He actually went thru
the effort of building the ISAM wrapper, and discovered that
the overhead wasn't material.

You ought to consider the possibility that perhaps he is right,
and that perhaps you are trying to optimize something that does
not need to be optimized.

Remember Michael Jackson's _First Rule of Software Optimization_,
which is expressed in one word:

Don't.

(And then there's his second rule, for experts: "Don't do it yet.")
--
(format nil "~S(at)~S" "cbbrowne" "acm.org")
http://www.ntlug.org/~cbbrowne/sap.html
Rules of the Evil Overlord #78. "I will not tell my Legions of Terror
"And he must be taken alive!" The command will be: ``And try to take
him alive if it is reasonably practical.''"
<http://www.eviloverlord.com/>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-04-20 13:53:19 Re: postgresql start/stop/status script
Previous Message Fritz Bayer 2005-04-20 13:27:19 Encoding problem