Mehdi Akiki

Posts tagged "performance"

  • Published on

    Investigation · Part 3 of 10 · Inside a database index

    What an Index Costs on Every Insert

    I inserted one million rows into SQLite with 0, 1, 3 and 6 indexes. The table alone took 0.8 s and six indexes took 8.5 s, but the biggest cost was not the number of indexes: one index on a random column made SQLite pass 4 GB to write() for a 106 MB file.
  • Published on

    Investigation · Part 2 of 10 · Inside a database index

    Reading EXPLAIN QUERY PLAN: SCAN Versus SEARCH

    SQLite says SCAN or SEARCH before it runs a query. I measured what the two words mean on one million rows: 16,469 pages against 7, and about 34 ms against 6 microseconds when the file is cached. With a cold cache the gap is much smaller.
  • Published on

    Reference · Derived state

    Cursor Pagination vs Offset Pagination

    Offset pagination is easy to write and breaks in two ways: it gets slow, and it skips or repeats rows when the data changes. Cursor pagination fixes both. Here is the difference.
  • Published on

    Reference · Through the layers

    The 4 Real Reasons Kafka Is Fast

    "Kafka is fast" is correct but too abstract. Here is the concrete version: four cheap operations that explain why Kafka handles millions of messages without breaking a sweat.