TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A terrible schema from a clueless programmer

33 点作者 ciprian_craciun超过 3 年前

9 条评论

08-15超过 3 年前
I must be missing something, but the &quot;solution&quot; with the 3NF and five separate tables with their own indices seems artificial and like pointless overengineering. Isn&#x27;t this solved by a single index?<p>Or maybe a relational DB is already overengineering. Using a hash table (some libdbm lookalike) to map (ip,helo,from,to) to (time) solves the problem, too, and doesn&#x27;t have a low performance failure mode.<p>This doesn&#x27;t change the major point about everyone having been a newbie at point, though.
评论 #29140339 未加载
评论 #29147835 未加载
hanche超过 3 年前
The important bit comes at the end:<p>&gt; That&#x27;s right, <i>I</i> was that clueless newbie who came up with a completely ridiculous abuse of a SQL database that was slow, bloated, and obviously wrong at a glance to anyone who had a clue.<p>&gt; My point is: EVERYONE goes through this, particularly if operating in a vacuum with no mentorship, guidance, or reference points. Considering that we as an industry tend to chase off anyone who makes it to the age of 35, is it any surprise that we have a giant flock of people roaming around trying anything that&#x27;ll work?
wodenokoto超过 3 年前
I&#x27;m kinda shocked that relational databases work so poorly out the box, that you can&#x27;t even have a simple table with 4 or 5 values you care about, but have to split it out into 5 different tables and then create business rules about how to connect those into the original table.
评论 #29138653 未加载
评论 #29137692 未加载
评论 #29137601 未加载
评论 #29138102 未加载
dekhn超过 3 年前
I remember when I first started to do &quot;real work&quot; in mysql (instead of just tiny crud apps). i wanted to store a tree structure, and talked to the most skilled DBA in the room (who happened to be our group admin). Turns out, the way to do this in sql is to make parent pointers (not list of child pointers), exactly the opposite of how everybody else in the world does it. Later I learned that postgres has compound types and array types which work fine for trees.
xupybd超过 3 年前
I&#x27;ve been there too but wouldn&#x27;t using an int to store the IP make more sense than pushing it out to its own table? Just as fast and one less table.
评论 #29138597 未加载
throwaway984393超过 3 年前
I think I care less about whether the programmer is clueless, and more about the immediate effects of that cluelessness. If their clueless implementation is meeting the minimum requirements and goals that it was intended for, then it doesn&#x27;t matter if it&#x27;s terrible or not, it&#x27;s good enough. If it&#x27;s not meeting the minimum requirements, then I want them to do it in a way that does.<p>Another thing I think about more often is when my code will die. Everybody&#x27;s code gets replaced eventually. How difficult will it be for the next person to replace your code? What kind of impact are you having on future generations? If I write my code to be super efficient and &quot;fancy&quot;, will it be that much more difficult to replace in the future? Could I have written it in a different way that made it easier to deal with? I hope I make the right decisions. I don&#x27;t want somebody to be cursing me when I&#x27;m long gone.
Enderboi超过 3 年前
<i>looks at greylisting table schema</i><p><i>looks at Rachel&#x27;s blog post</i><p><i>looks at greylisting table schema again</i><p>Doh! :P
greypowerOz超过 3 年前
greylisting was a fun time. And yes i too have absolutely been that person :)
valyagolev超过 3 年前
isn&#x27;t this a reinvention of indices?