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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

The Internals of PostgreSQL

328 点作者 kklisura超过 3 年前

6 条评论

jjice超过 3 年前
Part 3.1.1 is about the parser, which uses lex and yacc. I actually used it as a source to convince a professor to let us use lex and yacc to build our lexer and parser for a SQL engine for a DB implementation class I took. His expectations were a bit unrealistic for what a bunch of seniors would be able to accomplish in three weeks in C (other similar level of difficulty classes and job searching weigh a real burden), and he initially said no to me asking if we could use lex and yacc. Postgres&#x27;s source made a convincing enough argument. Gave me a reason to learn lex and yacc, as well as making a much easier to modify parser. I wrote the parser for my group, and we were the only group that finished the parser in time, and at all.<p>Just an anecdote with some fond memories that were made possible by Postgres and its internals. Postgres has a place in my heart for that, and being a damn fine DB of course!
评论 #30090154 未加载
评论 #30093029 未加载
评论 #30123183 未加载
评论 #30089772 未加载
kklisura超过 3 年前
&gt; ...postgres server process listens to one network port, the default port is 5432<p>&gt; Whenever receiving a connection request from a client, it starts a backend process. (And then, the started backend process handles all queries issued by the connected client.)<p>&gt; To achieve this [server] starts (&quot;forks&quot;) a new process for each connection. From that point on, the client and the new server process communicate without intervention by the original postgres process. Thus, the master server process is always running, waiting for client connections, whereas client and associated server processes come and go. [1]<p>So, Postgres is using process-per-connection model. Can some explain why this is? And why not something like thread-per-connection?<p>[1] <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;9.6&#x2F;tutorial-arch.html" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;9.6&#x2F;tutorial-arch.html</a>
评论 #30093625 未加载
评论 #30093014 未加载
评论 #30098112 未加载
评论 #30093468 未加载
grantjpowell超过 3 年前
I constantly recommend this at work. The specific content isn&#x27;t super helpful to Saas day to day development, but for me it built an intuition about postgres that has been invaluable. I think once I understood the &quot;heart and soul&quot; of postgres, the heap and the mvcc, many other properties about the database just &quot;clicked&quot; in my head.
评论 #30090150 未加载
dang超过 3 年前
Past related threads:<p><i>The internals of PostgreSQL</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13488315" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13488315</a> - Jan 2017 (53 comments)<p><i>The Internals of PostgreSQL</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12142364" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=12142364</a> - July 2016 (1 comment)
trulyme超过 3 年前
The license is interesting:<p>&gt; If you work at Amazon, you cannot use and refer to this document because of the copyright violation issues.<p>I wonder which one of the Amazon&#x27;s missteps triggered the OP&#x27;s ire. :)
评论 #30092296 未加载
评论 #30092881 未加载
评论 #30091573 未加载
Ostrogodsky超过 3 年前
The FAQ section is refreshingly and hilariously honest:<p><a href="https:&#x2F;&#x2F;www.interdb.jp&#x2F;pg&#x2F;faq.html" rel="nofollow">https:&#x2F;&#x2F;www.interdb.jp&#x2F;pg&#x2F;faq.html</a>