postgres
postgres
postgres
How can I check the size of the database and tables in PostgreSQL?
PostgreSQL database size checks in a few simple SQL queries: list all databases with pg_database and pg_size_pretty, then break down the biggest tables in a schema, indexes included. Spot what eats disk space before it slows backups and raises infrastructure costs.
postgres-16
PostgreSQL indexing for newbies - Practical Guide
PostgreSQL indexing explained for beginners: how B-tree, BRIN, GIST, and GIN indexes work, reading EXPLAIN ANALYZE to see if they are used, maintenance and hit rate tips, and clear rules for when an index helps and when it just slows your writes down.
Latest
Mastering database enums in Rails with Postgres - Guide
Database enums in PostgreSQL give Rails apps type safety, implicit ordering, and faster queries than string columns. Single-value enums with validation, multi-select enum arrays, dynamic enum management, and the migrations that wire it all together.
How to run Rails console in safe sandbox mode?
Rails console sandbox mode wraps every database operation in a transaction and rolls it all back on exit, so you can experiment safely. How to launch it, plus the traps: database locking, non-rollbackable operations, and why production use still needs care.
What is ACID?
ACID stands for Atomicity, Consistency, Isolation, and Durability: the four guarantees behind reliable database transactions. Each property explained with a concrete Rails example, like wrapping a money transfer in a transaction so it fully succeeds or rolls back.
Solutions to paginate data in your databse and which one is the best
Database pagination goes beyond LIMIT and OFFSET: ROW_NUMBER(), the FETCH clause, and keyset pagination each behave differently as tables grow. SQL examples for every approach, why offsets get slow on big datasets, and a verdict on which method scales best.
Database shrading and database partitioning in Rails
Database sharding in Rails step by step: create a separate database per shard, wire them up in database.yml, and query across them. Plus how sharding differs from partitioning, with a native PostgreSQL partitioning example done through Rails migrations.
Rails optimistic locking, pessimistic locking and how to solve StaleObjectError
Rails locking strategies for concurrent updates: optimistic locking with a lock_version column that works out of the box, pessimistic locking with lock! and with_lock, and practical ways to rescue and resolve the StaleObjectError that optimistic locking raises.
Rails eager_load, joins and includes - when to use what
Rails eager_load, includes, preload, and joins each fight slow queries differently: LEFT OUTER JOIN versus separate queries, how includes picks its strategy, and when a plain joins is enough. Clear examples showing which loading method to choose for each situation.