Thread: Nullability patch take 2

Nullability patch take 2

From
Christopher Kings-Lynne
Date:
Updated to match Tom's new semantics.  passes my own regression tests plus
all existing ones...

Chris


Attachment

Re: Nullability patch take 2

From
Tom Lane
Date:
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> Updated to match Tom's new semantics.  passes my own regression tests plus
> all existing ones...

Checked and applied.  I made one nontrivial change --- for anything on
which there's a syscache, it's a lot easier (and faster) to use
SearchSysCacheCopy to get a tuple to update than it is to do a heapscan.
The syscache will either have the tuple already, or will get it with an
indexscan --- either way wins over a heapscan when the catalog is at
all large.

(One of the things on my to-do list is to get rid of unnecessary
heapscans on system tables; there are still a few of 'em in code
paths that are used enough to be worth worrying about.)

            regards, tom lane

Re: Nullability patch take 2

From
"Christopher Kings-Lynne"
Date:
> Checked and applied.  I made one nontrivial change --- for anything on
> which there's a syscache, it's a lot easier (and faster) to use
> SearchSysCacheCopy to get a tuple to update than it is to do a heapscan.
> The syscache will either have the tuple already, or will get it with an
> indexscan --- either way wins over a heapscan when the catalog is at
> all large.

Cool.  Question - are all these little tricks documented somewhere?  I'm
considering improving the source code section of the manual to include
HOWTOs for coding with Postgres - might attract more patches.  I mean, if
I'd been given a list of all these things, with implementation examples,
beforehand it'd make my life a lot easier.

BTW - would you be able to comment on my earlier email regarding hints for
letting the executor handle rangevars from stored procedures???

Chris


Re: Nullability patch take 2

From
Tom Lane
Date:
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Cool.  Question - are all these little tricks documented somewhere?

I don't think so :-(.  Looking at existing examples in the code is about
the only way at the moment; but some parts are coded better than others,
and it's not always obvious which is which.

> I'm considering improving the source code section of the manual to
> include HOWTOs for coding with Postgres - might attract more patches.

Great idea... but you'll have to do some work to create the material...

            regards, tom lane