[Pljava-dev] advice needed

From: thhal at mailblocks(dot)com (Thomas Hallgren)
To:
Subject: [Pljava-dev] advice needed
Date: 2005-02-17 01:51:07
Message-ID: thhal-0DZHvAqOQxicfVlTE4v+ij9n2gNWEGu@mailblocks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

George,
Lot of words. It all boils down to two things:
1. Creating a ResultSet in memory is often unacceptable.
2. Not all sets are the result of a query towards the database.

There's no point in discussing the likelyhood of this versus that. I'm
trying to explain to you why the current design makes perfect sense but
I don't seem to communicate that very well. I suggest you think of the
following scenarios, perhaps that will make you realize what all of this
is good for.

1. A big mainframe system has a Java API that allows you to query
certain information. The system uses Java serialization to stream the
result back to you through an ObjectInputStream. The objects that you
read follow Java beans standard with getters for each column. Millions
of rows might be returned as the result of a query. You want a function
that returns a SETOF a type that corresponds to the Java beans. What do
you do?

2. You have several very large XML documents on disk. The documents
contain millions of elements of a certain type. You have a streaming SAX
parser that can parse the documents, one element at a time. You want a
function that returns elements from such a document as a SETOF a type
that matches the type of the element. Reading all of the document into
memory is not an option. How do you solve this?

3. You need a type where some columns match columns in an existing table
but two or more columns are computed using some advanced algorithm that
you've implemented in Java. The database table contains millions of
records. You want a function that returns a SETOF this type. How would
you create such a function?

Regards,
Thomas Hallgren

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Thomas Hallgren 2005-02-17 07:50:02 [Pljava-dev] advice needed
Previous Message George 2005-02-17 00:31:20 [Pljava-dev] advice needed