Re: PLJava and Database Meta Data

Поиск
Список
Период
Сортировка
От Markus Schaber
Тема Re: PLJava and Database Meta Data
Дата
Msg-id 420CAB1A.10908@logi-track.com
обсуждение исходный текст
Ответ на Re: PLJava and Database Meta Data  (Thomas Hallgren <thhal@mailblocks.com>)
Ответы Re: PLJava and Database Meta Data  (Thomas Hallgren <thhal@mailblocks.com>)
Список pgsql-jdbc
Hi, Thomas,

Thomas Hallgren schrieb:

>> For complex datatypes, if you use the internal representation for your
>> java mapping, you have to parse bytes, 32-bit integers, doubles and such
>> from the in-memory representation.
>>
> We never parse any bytes. The internal representation of a double in the
> backend is, a double. The SPI layer communicates values in terms of
> datums that holds C-language char, short, int, long, float, double, etc.
> values and JNI treats them as their native Java correspondance in the
> Java layer.  The same is true for the actuall call handler used for SQL
> function calls into Java.

Okay, so this is fine for primitive types. How does SPI deal with
complex types?

>> Alternatively, you can use the canonical representations
>> (using the types INPUT/OUTPUT/SEND/RECEIVE functions), but this incurs
>> additional overhead.
>>
> Do you have any concrete measurments where this overhead is significant?
> In my experience, using input/output/send/receive incurs a very low
> overhead. I doubt that it's even measurable.

Yes, I have. Especially for large geometries. In our database, we have
geometry objects up to 20MB per piece. Also, in PostGIS, send/receive
binary representation differs slightly from internal representation (and
input/output text is even more overhead).

>> Is there any documentation about such PLJava internals?
>>
> The source code :-)
> Seriosly, if you want to know PLJava internals, it's not that bad to
> look at. It's fairly well commented.

Okay, I'll do so.

Markus

--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Thomas Hallgren
Дата:
Сообщение: Re: PLJava and Database Meta Data
Следующее
От: Thomas Hallgren
Дата:
Сообщение: Re: PLJava and Database Meta Data