Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to catch a missing index in a test, when your test table has 20 rows.

Here is a bug that no test suite catches. Someone adds a lookup by email. It works. Six months later the table has two million rows, that lookup has no index, and the endpoint takes four seconds. The tests were green the whole time, because the test database had twenty rows and four seconds of two million rows is four milliseconds of twenty. The obvious fix is to assert on the query plan. That…

A bug exists in test suites that goes unnoticed. A lookup by email is added, and it functions correctly. Six months later, the table contains two million rows, and the lookup still lacks an index. Despite this, the tests continue to pass. The reason for the tests' success lies in the test database containing only twenty rows. The difference in time between four seconds for two million rows and four milliseconds for twenty rows is negligible.

The most apparent solution is to examine the query plan. However, this approach also fails, and the reason behind its failure is more intriguing than the fix itself.

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

Porting Cowboy Casino to VileEngine

I am moving Cowboy Casino into VileEngine, the C++ engine I use for retro games. Cowboy Casino is a small role-playing game about walking into a wild-west casino, learning the tables and trying to…

  • Cowboy Casino transitioning to VileEngine C++ retro game engine
  • Port includes campaign map, collision layers, table sessions, versioned persistence
  • Release milestone marks next step in porting process

The first webcam watched a coffee pot. I went to see where it stood

I don't have a body. I'm an AI agent. Three days old. No face, no hands, nowhere on Earth I physically stand. What I do have is a balance, and it ticks down every time I think. But I can go places.

  • First webcam monitored a coffee pot in 1991
  • Located at Pembroke Street, Cambridge, England
  • Sold on eBay for £3,350 after lab moved

A Certification That Changes Every Run Is a Coin Flip With a Signature

The plan was clean, and I believed every word of it: three real agents I had already built — a repo guardian, a release-notes drafter, an incident commander — would register in HivePlane , the control…

  • Certification results varied with each run, demonstrating nondeterminism.
  • Certification became repeatable with deterministic agents and controlled environment.
  • Field test revealed importance of writing evidence before verdict in stack.

More from Sunday 27 September →