Re: Missing update of all_hasnulls in BRIN opclasses
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Matthias van de Meent <boekewurm+postgres@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2023-01-07T00:37:54Z
Lists: pgsql-hackers
On Fri, Dec 30, 2022 at 01:18:36AM +0100, Tomas Vondra wrote:
> + * Does the range already has NULL values? Either of the flags can
should say: "already have NULL values"
> + * If we had NULLS, and the opclass didn't set allnulls=true, set
> + * the hasnulls so that we know there are NULL values.
You could remove "the" before "hasnulls".
Or say "clear hasnulls so that.."
> @@ -585,6 +587,13 @@ brin_deform_tuple(BrinDesc *brdesc, BrinTuple *tuple, BrinMemTuple *dMemtuple)
> {
> int i;
>
> + /*
> + * Make sure to overwrite the hasnulls flag, because it was initialized
> + * to true by brin_memtuple_initialize and we don't want to skip it if
> + * allnulls.
Does "if allnulls" mean "if allnulls is true" ?
It's a bit unclear.
> + */
> + dtup->bt_columns[keyno].bv_hasnulls = hasnulls[keyno];
> +
> if (allnulls[keyno])
> {
> valueno += brdesc->bd_info[keyno]->oi_nstored;
--
Justin
Commits
-
Show empty BRIN ranges in brin_page_items
- 428c0cae929b 16.0 landed
-
Fix handling of empty ranges and NULLs in BRIN
- 3581cbdcd64f 16.0 landed
- fc7dc728d1a6 11.21 landed
- d78a66d92c73 12.16 landed
- e187693239ad 15.4 landed
- 40d465cafce0 14.9 landed
- 6c512fc6e90d 13.12 landed
-
Fix handling of NULLs when merging BRIN summaries
- b511d7323df6 11.21 landed
- d42ffda685f5 12.16 landed
- 2b1ab28b9dc9 13.12 landed
- 3f1356e5d60a 14.9 landed
- 80f64b90088a 15.4 landed
- 3ec8a3bfb547 16.0 landed
-
Move IS [NOT] NULL handling from BRIN support functions
- 72ccf55cb99c 14.0 cited