Skip to content

Instantly share code, notes, and snippets.

View dineshbhagat's full-sized avatar
🌏 dev-engers assemble

DB dineshbhagat

🌏 dev-engers assemble
View GitHub Profile
@dineshbhagat
dineshbhagat / zigzag-encoding.README
Created November 9, 2019 06:55 — forked from mfuerstenau/zigzag-encoding.README
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
@dineshbhagat
dineshbhagat / brin_btree_demo.md
Created October 24, 2022 03:20 — forked from dmagda/brin_btree_demo.md
A little demo for the BRIN vs. B-tree index in PostgreSQL