Re: [HACKERS] Does having a NULL column automatically exclude the table from the tupleDesc cache?

2017-02-19 Thread Ryan Murphy
> > You'll probably want to do those at a C level, bypassing the executor. I > > would guess that executor overhead will completely swamp the effect of > the > > cache in most cases. > > That seems like it's kind of missing the point. If the tupleDesc > cache saves so little that it's irrelevant

Re: [HACKERS] Does having a NULL column automatically exclude the table from the tupleDesc cache?

2017-02-19 Thread Robert Haas
On Sat, Feb 18, 2017 at 12:33 AM, Jim Nasby wrote: > On 2/15/17 1:37 PM, Ryan Murphy wrote: >> attcacheoff can only be set positive for fields preceding any varlena >> (typlen<0, but including the first such) or nullable values. I don't >> know how much

Re: [HACKERS] Does having a NULL column automatically exclude the table from the tupleDesc cache?

2017-02-17 Thread Jim Nasby
On 2/15/17 1:37 PM, Ryan Murphy wrote: attcacheoff can only be set positive for fields preceding any varlena (typlen<0, but including the first such) or nullable values. I don't know how much faster it is with the cache; you can measure it if your curiosity is strong enough --

Re: [HACKERS] Does having a NULL column automatically exclude the table from the tupleDesc cache?

2017-02-15 Thread Ryan Murphy
> attcacheoff can only be set positive for fields preceding any varlena > (typlen<0, but including the first such) or nullable values. I don't > know how much faster it is with the cache; you can measure it if your > curiosity is strong enough -- just set the first column to nullable. > > Thanks!

Re: [HACKERS] Does having a NULL column automatically exclude the table from the tupleDesc cache?

2017-02-15 Thread Alvaro Herrera
Ryan Murphy wrote: > My question kind of remains though - does that mean that having any nulls > in the tuple loses the ability to use the tupleDesc cache? and how much of > a performance impact is this? I'm sure there's a good reason why you can't > really use the cache if you have a null

Re: [HACKERS] Does having a NULL column automatically exclude the table from the tupleDesc cache?

2017-02-15 Thread Ryan Murphy
> No, that tests whether the particular tuple contains any null fields, not > whether the whole table is declared NOT NULL. > > regards, tom lane > Ok, thanks, that makes sense. My question kind of remains though - does that mean that having any nulls in the tuple loses

Re: [HACKERS] Does having a NULL column automatically exclude the table from the tupleDesc cache?

2017-02-15 Thread Tom Lane
Ryan Murphy writes: > My question is this: HeapTupleNoNulls() is run first to see if there are > any columns that can be NULL. It looks like the fetchatt() that uses the > cache in the tupleDesc can only be used if there are no NULLable columns in > the table. Is my

[HACKERS] Does having a NULL column automatically exclude the table from the tupleDesc cache?

2017-02-15 Thread Ryan Murphy
Hi all, I was looking through some of the implementation details of the heap/tuples, specifically src/include/access/htup_details.h - and I came across the big macro fastgetattr, and had a question about it. I've included the code here for clarity and convenience: #define fastgetattr(tup,