9 #PostgreSQL Indexing Tips Every #rails Dev Should Know 🚀
Indexes are your first #database optimization tactic. Get them right, and everything else gets easier.
1️⃣ BTREE – The default. Rock solid for lookups.
2️⃣ GIN – JSONB & full-text search on steroids.
3️⃣ BRIN – Huge, sequential tables? Use this.
4️⃣ Partial – Only index what actually matters.
5️⃣ Covering – Store extra columns, skip table lookups.
6️⃣ Unique – Constraints, but without the overhead.
7️⃣ Concurrent – Add indexes without downtime.
8️⃣ Expression – Index computed values, query smarter.
9️⃣ Multi-Column – Optimize multiple WHEREs.
Let’s break these down 🧵👇
3️⃣ BRIN Indexes – Best for large, sequential tables (think logs, time-series, analytics).
🔹 Example: Index logs efficiently
CREATE INDEX idx_logs_time ON logs USING BRIN (created_at);
Now queries like:
SELECT * FROM logs WHERE created_at BETWEEN '2024-01-01' AND '2024-02-01';
Runs way faster with minimal index size.
✅BRIN indexes don’t store individual values, just value ranges.
✅Perfect for tables with billions of rows that grow sequentially.
Lai atrastu īsāko rindu pie valsts apmaksāta ārsta, izmanto - https://t.co/ZwhITwdPI4
Vēl tikai pietrūkst e-pieraksts @VMNVD 🙏
RT un padod tālāk citiem!
@krizdabz Iesaku pamēģināt Flux - https://t.co/WTdNlViwdd .
Manuprāt, labāks par midjourney + arī bezmaksas . (izmaksas vienīgi tik cik palaist caur kādu GPU resursu).
@krizdabz Bez klasiskajiem objektiem.
https://t.co/6cz8tXlR0Z - atkarībā no bērna vecuma, varētu būt interesanti. Zoo noteikti ar bērniem būs arī interesants.
Kebabs: "Mustafa’s Gemüse Kebap" ļoti gards un slavens (var būt rindas 30+min).
Checkpoint Charlie, Muzeju sala.
Ir skumji cilvēki, ir reāli bēdīgi un ir tie, kas seko @IngaSpringe tikai, lai atbildētu uz katru tvītu ar kaut ko debīlu :D Es saprotu, ka var nepatikt cilvēks vai viedoklis, bet cik daudz brīvajam laikam jābūt, lai veltītu tik lielu uzmanību cilvēkam, kurš tev nepatīk?