Skip to content

Allow HOT for BRIN indexed columns. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Allow HOT for BRIN indexed columns. #7

wants to merge 2 commits into from

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