Hard-to-read databases make AI development 1.9x more expensive: a Claude Code experiment
The author ran an experiment with Claude Code to see how database design affects AI development cost, building two versions of the same e-commerce database: one with conventional naming, column comments, foreign keys and logical deletion[1] via Laravel's deleted_at, the other with abbreviations like ord.sts and prc_a, no comments, no foreign keys and dates stored as char(14) strings. The design criteria were drawn up in consultation with Claude, and both versions ran the same stack (Laravel 13, MySQL 8.4, PHP 8.4 in Docker) with the model fixed to claude-sonnet-5-5. Each condition got five runs of the same task — a query returning the top 10 products by sales for a given month — and the unreadable database averaged $0.41 in estimated cost versus $0.21, 26.2 turns[2] versus 18.8, 109 seconds versus 60 and 2.1 times more cache read[3] tokens, failing the acceptance test[4] once. Bash commands against the real database more than doubled (11.8 versus 5.0 per run), because the AI had to inspect data to guess what columns like odt and dflg meant. The one failure came from the AI converting Japanese month boundaries to UTC since nothing said the dates were stored in JST; the author notes only five runs were made, without statistical testing and with overlapping cost ranges, and concludes that design readable for humans is equally readable for AI.
Sources
-
JPZenn JA
「読みにくいDB」はAI開発のコストを1.9倍にする――Claude Codeで検証したDB設計の影響


