Skip to content

Conversation

simi
Copy link
Owner

@simi simi commented Jun 13, 2021

How to test?

CREATE TABLE mytable (             
   id  integer PRIMARY KEY,        
   val integer NOT NULL            
) WITH (autovacuum_enabled = off, fillfactor = 70); 

INSERT INTO mytable SELECT *, 0 FROM generate_series(1, 235);
CREATE INDEX val_brin ON mytable using brin(val);
UPDATE mytable SET val = -3 WHERE id = 42;

SELECT pg_sleep(1); /* pg_stat_user_tables is not immediately updated */

SELECT n_tup_upd, n_tup_hot_upd                                                            
FROM pg_stat_user_tables
WHERE schemaname = 'public'
  AND relname = 'mytable';

/* with this patch */
 n_tup_upd | n_tup_hot_upd 
-----------+---------------
         1 |             1

/* on master */
 n_tup_upd | n_tup_hot_upd 
-----------+---------------
         1 |             0

TODO

  • INDEX_ATTR_BITMAP_ALL is used only for HOT decision and since it is not used anymore, it could be removed 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant