David Christensen (@pg_dwc) header
David Christensen (@pg_dwc) profile picture

PostgreSQL, music, math

Lawrence, KS
Joined May 2021
Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)Photo by David Christensen (@pg_dwc)
When you're married to a Postgres person and you share everything - including a job, a house, and a bunch of kids ... pretty sure GROUP BY ALL is the ultimate SQL patch to represent that. ❤️ 🐘
1
1
11
445
David Christensen retweeted
Let’s talk about Postgres scan types. Most of us have been in EXPLAIN and read some plans. Here’s some details about the different scan types and a diagram for thinking about how they work. ❖ Sequential scan: reads the entire table, row by row checking to see what matches the query conditions. ❖ Index Scan: A basic index scan uses a B-tree to quickly find the exact location of the data. It's a two-step process where first Postgres finds the entry in the index and then the row it fetches the row from the table. ❖ Bitmap Scan: 1. Bitmap Index Scan: First, Postgres scans one or more indexes to create an in-memory "bitmap", a simple map of all the table pages that *might* contain rows you need. 2. Bitmap Heap Scan: The bitmap is used to visit the main table. The key here is that it reads the required pages from the disk sequentially, which can be much faster than the random jumping of a standard index scan. ❖ Parallel Sequential Scan: Postgres uses multiple background workers to perform a Sequential Scan on a single large table at the same time. The table is broken into chunks, and each worker gets a chunk to scan. They all work in parallel, and their results are combined at the end in a gather process. ❖ Parallel index scan: Postgres uses multiple background workers to scan different portions of a single B-tree index concurrently and return matching rows from the heap; workers take turns reading from the index. ❖Index-Only Scan: An Index-Only Scan is the superstar of scans and answers the entire query using only the information stored within the index itself. It never even has to touch the main table.
29
137
8,861
David Christensen retweeted
\conninfo is a command in psql for showing your current connection details. If multiple terminal windows and databases are open, you can check connection details without logging out and back in. \conninfo will display: -database name -username -host and port of the database server (local sockets just show the port) -connection type Sample results look like this: postgres# \conninfo You are connected to database "postgres" as user "application" via socket in "/tmp" at port "5432". Postgres history: this feature was a patch written by our engineer David Christensen, @pg_dwc.
1
8
418
David Christensen (@pg_dwc): Building PostgreSQL Extensions: Dropping Extensions and Cleanup postgr.es/p/6sR
4
27
2,445
I've joined the Board of The United States PostgreSQL Association @pgus 🥳🐘. Our mission of education in PostgreSQL is something I care a lot about. If you have thoughts on Postgres events, education, diversity, or any of our initiatives, reach out anytime.
5
6
34
2,232
David Christensen retweeted
1
4
7
456
David Christensen retweeted
We're at @pgDayParis today! Elizabeth and Jean-Paul are excited to chat Postgres, be sure to stop by the @crunchydata table. @sqlliz @jpargudo
1
16
1,335
David Christensen retweeted
Last week at @socallinuxexpo David and Elizabeth covered some of the things they encountered in the last year working with a 25TB+ PostgreSQL database. @sqlliz @pg_dwc youtube.com/watch?v=cBVRtrEh…
1
3
472
David Christensen retweeted
Was way to excited to eavesdrop on a “it was the best SQL I have ever seen” conversation, only to realize they meant a movie sequel
4
9
52
4,301
Replying to @pg_dwc
@pg_dwc and I will be doing a talk 👯 at @socallinuxexpo in LA March 9-10 at #Postgres days. We'll be talking about running 🐘 at Scale with really big databases. David has a ton of tips he's collected over the last few years. Come see us and other great Postgres folks!
1
1
96
David Christensen retweeted
Our own Elizabeth Christensen (@sqlliz) presented, How To Be a Postgres DBA in a Pinch at DjangoCon US 2022. You can find the recorded talk here: youtube.com/watch?v=UAtW6t9L…
2
10
944