Postgres

Articles related to Postgres from the team that helps B2C companies build and defend revenue with AI.

4 min read

How to generate UUID ranges for SQL queries

So you've got a table with a UUID primary key. How do you search for only 1/4, or 1/8, or 1/128 of it? BETWEEN '00000000-0000-0000-0000-000000000000' AND '3fffffff-ffff-ffff-ffff-ffffffffffff' BETWEEN '40000000-0000-0000-0000-000000000000' AND '7fffffff-ffff-ffff-ffff-ffffffffffff' BETWEEN '80000000-0000-0000-0000-000000000000' AND 'bfffffff-ffff-ffff-ffff-ffffffffffff' BETWEEN 'c0000000-0000-0000-0000-000000000000' AND 'ffffffff-ffff-ffff-ffff-ffffffffffff' And how do you generate those ranges? Here

Read more