Daily Shaarli

All links of one day in a single page.

April 28, 2026

Partition Table of PostgreSQL Hash and Partition ID Calculation - Alibaba Cloud Community
thumbnail

Calculation Method:

  (  
    (  
      (hashint4extended(id, 8816678312871386365)::numeric + 5305509591434766563  
      ) % 256  
    )::int + 256  
  ) % 256  

Or

  (case   
  when   
    (hashint4extended(id, 8816678312871386365)::numeric + 5305509591434766563) % 256 < 0   
  then  
    256 + (hashint4extended(id, 8816678312871386365)::numeric + 5305509591434766563) % 256  
  else   
    (hashint4extended(id, 8816678312871386365)::numeric + 5305509591434766563) % 256  
  end)::int  
The Hidden Behavior of plan_cache_mode
Understanding Bitmap Heap Scans in PostgreSQL