Re: Selecting a constant question - Mailing list pgsql-hackers

From Zeugswetter Andreas ADI SD
Subject Re: Selecting a constant question
Date
Msg-id E1539E0ED7043848906A8FF995BDA57902240F93@m0143.s-mxs.net
Whole thread Raw
In response to Re: Selecting a constant question  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-hackers
> > Again, *all* other major relational databases do this ...
> even blob fields have a maximum length reported from the database.
>
> So what are you doing with the max length? Not all data types
> and values have a meaningful max length, so you have to be
> able to deal with variable length data anyway.

Imho it has a lot to do with optimizing the interface.
If you know, that the max length is e.g. 16 bytes in UTF-8 for the 3
chars, you will probably not want any on the fly allocation smarts and
preallocate and bind those 16 bytes. When the max length value gets
larger, and it is a variable lenght type, the overhead of varlen
allocation smarts starts to pay off.

A generic interface should keep the sql parsing smarts at a minimum,
thus it cannot know that a returned column is actually a text constant.

Imho the request for a max length is very reasonable, but has no value
once it exceeds a certain size e.g. 64k.

Andreas


pgsql-hackers by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: Autovacuum launcher doesn't notice death of postmaster immediately
Next
From: Zdenek Kotala
Date:
Subject: Re: Autovacuum launcher doesn't notice death of postmaster immediately