Urgent.News

What's breaking now, across thousands of outlets.

Tech

Database Indexing โ€“ Part 1: How Indexes Help Find Data Faster

Recently, I was reading two books: Good Vibes, Good Life and The Mountain Is You . I usually forget things after some time ๐Ÿ˜…. So whenever I want to revisit something I've read, I go back to the book. But I noticed one difference between these two books. Good Vibes, Good Life has an index at the end of the book. Whenever I want to read about a particular topic, I can look at the index, find theโ€ฆ

The article explores the concept of database indexing, specifically how indexes in PostgreSQL help find data more efficiently. The author uses the analogy of an index in a book to illustrate the purpose of database indexes.

To demonstrate the efficiency of indexes, the author creates a large table named "employees" with three columns: id, name, and salary. By inserting 10 million records into this table, the author creates a scenario where searching for a specific record would take a considerable amount of time without an index.

When searching for a specific record using the id column without an index, PostgreSQL would scan the entire table, checking each row to find the desired data. However, when an index is created on the id column, PostgreSQL can use the index to quickly locate the required record.

The article explains that an Index Only Scan is used when PostgreSQL can retrieve the required data directly from the index without accessing the full table records. This approach is much faster than scanning the entire table, especially when dealing with large datasets.

The author also explains the output of the EXPLAIN command, which provides detailed information about how PostgreSQL executes a query. This output includes information about the execution plan, estimated costs, actual execution times, and buffer usage.

In summary, the article highlights the importance of database indexing and demonstrates how indexes in PostgreSQL can significantly improve query performance by allowing the database to quickly locate specific records, just like an index in a book helps find information without reading every page.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in Tech

I almost rebuilt a project for the wrong reason, a 20 minute audit caught it

I have an iPhone-driving rig. An ESP32 board plugs into the phone over USB and plays human, screen taps, button presses, the works, so my local agent can actually operate the phone instead of justโ€ฆ

  • Reporter conducted 20-minute audit before planning rebuild
  • Audit found old code clean, no security issues
  • New rebuild justified by architectural improvements, not security

Node.js Marketplace Verification: 6 Secure SMS OTP Login Flow Lockout and Replay Defenses

Short answer: design a secure SMS OTP login flow by putting rate limiting, retry control, lockout, and replay protection in your Node.js backend, before and after the provider call.

  • Implement six security gates before provider call in Node.js OTP flow
  • Seller requests vehicle service report, backend enforces defenses
  • Protect provider call with idempotency key and exponential backoff

When a cert-manager Keystore Runs Behind a Password Change

cert-manager v1.21.2's API reference: "The keystore file will be updated immediately." After a password change, the keystores opened only with the old password throughout our 30-minute window.

  • Cert-manager v1.21.2 has keystore password change issue
  • Keystore entries remain encrypted for 30 minutes post-change
  • Certificate stays Ready=True, but entries stay encrypted

I Built SpeedPulse: An Open-Source Internet Speed Tester with ASP.NET Core 10 and TypeScript

I Built SpeedPulse: An Open-Source Internet Speed Tester with ASP.NET Core 10 and TypeScript After working on its testing interface, diagnostics, backend, and release pipeline, I'm excited toโ€ฆ

  • SpeedPulse v1.0.0, open-source internet speed tester launched
  • Features connection speed testing, interactive dashboard, developer labs
  • Available for download via GitHub Pages or self-hosted ASP.NET Core 10

More from Saturday 17 October โ†’