Hatena
"Hard-to-Read DBs" Could Make AI Development Costs 1.9x – DB Design Impact Tested with Claude Code
AIFirst seen 66 points
A Japanese developer tested how database design affects the cost of AI coding tools. When the database was hard to read, the AI cost about 1.9 times more and took more steps.
What happened
A developer at Actobi tested two versions of the same online shop database with Claude Code, an AI coding agent. One version had clear names, comments, and links between tables. The other used short, unclear names and no comments or links. The AI got the same task in both cases: write a query for the top 10 products by sales in a given month.
Key numbers
- The hard-to-read database cost about 1.9 times more ($0.41 vs. $0.21 on average over 5 runs).
- The AI used about 1.4 times more turns and about 1.9 times more output tokens.
- It took about 1.8 times longer (109 seconds vs. 60 seconds).
- The clear database passed 5 out of 5 tests. The hard-to-read one passed 4 out of 5.
Background
AI agents read the database structure to understand it. A token is a small piece of text that the AI reads or writes, and more tokens mean more cost. When a column name like 'sts' has no explanation, the AI has to check the real data to guess what it means.
Why it matters
As more teams build software with AI, AI costs will matter as much as development speed. The test suggests that good database design, such as clear names, comments, and links between tables, helps people and AI alike. When the AI guesses missing facts, it can also make mistakes that look right, so clear design also helps prevent errors.
What to watch
- The test used only 5 runs per condition, so the results are not statistically proven.
- The hard-to-read database was designed on purpose and may not match real systems.
- Names and comments were changed together, so it is unclear which one had more effect.
- The test covered only one kind of task. Bug fixing or adding features may give different results.
- Results may change with a different AI model or different settings.
Glossary
- Claude Code
- An AI tool from Anthropic that writes and changes code on its own, based on instructions.