From: cbbrowne@cbbrowne.com
To: Hiroshi Inoue <inoue@tpf.co.jp>
Cc: pgsql-hackers@postgresql.org
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Roadmap for FE/BE protocol redesign
Date: Thu, 13 Mar 2003 10:35:43 -0500
Message-ID: <20030313153543.BAB6935008@cbbrowne.com> (raw)
In-Reply-To: <inoue@tpf.co.jp> <000301c2e971$f9d57f50$0e283ddb@PbgX>
References: <000301c2e971$f9d57f50$0e283ddb@PbgX>
> > No, you do a single select that returns 100 results...
>
> Does a single select mean a fast select ?
Provably always? Perhaps not.
But requesting data via a single select statement returning 100 rows
means that you only have to submit the request once, and it means that
the result set only has to be set up once, which is quite likely to save
some work.
If you're going to read 100 lines of data from a file, would it make
more sense to:
a) Open the file 100 times, fseek() to the right spot, and then close
the file, or
b) Open the file once, and do 100 fseek() calls?
If you're just opening a file, there's not a huge amount of overhead
associated with that. Setting up a DBMS query is quite a bit more
costly, so that the effort looks like:
a) Open a session connection, submit a query for one record, and
process it, then close the connection, and do this 100 times,
versus
b) Open a session connection, submit a query returning 100 records,
and process them all.
The overhead surrounding submitting and processing the query is quite a
bit more than that involved in opening/closing files, so cutting down on
it should be pretty worthwhile...
--
(reverse (concatenate 'string "gro.gultn@" "enworbbc"))
http://cbbrowne.com/info/nonrdbms.html
"When we understand knowledge-based systems, it will be as before
-- except our fingertips will have been singed." -- Alan Perlis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: cbbrowne@cbbrowne.com, inoue@tpf.co.jp, pgsql-hackers@postgresql.org
Subject: Re: Roadmap for FE/BE protocol redesign
In-Reply-To: <20030313153543.BAB6935008@cbbrowne.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox