Nullability patch take 2

Started by Christopher Kings-Lynneover 24 years ago4 messagespatches
Jump to latest
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

Updated to match Tom's new semantics. passes my own regression tests plus
all existing ones...

Chris

Attachments:

alternotnull2.txt.gzapplication/x-gunzip; name=alternotnull2.txt.gzDownload
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#1)
Re: Nullability patch take 2

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

#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Christopher Kings-Lynne (#1)
Re: Nullability patch take 2

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

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#3)
Re: Nullability patch take 2

"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