invader (@DylanSchellenb1) profile picture
Joined February 2020
Photo by invader (@DylanSchellenb1)Photo by invader (@DylanSchellenb1)
Big moment for Postgres! Search has always been Postgres' weak spot, and everyone just accepted it. If you needed a real relevance-ranked keyword search, the default answer was to spin up Elasticsearch or add Algolia and deal with the data sync headaches forever. The problem isn't that Postgres can't do text search. It can. But the built-in `ts_rank` function uses a basic term frequency algorithm that doesn't come close to what modern search engines deliver. So teams end up: - Running a separate Elasticsearch cluster just for search - Building sync pipelines that inevitably drift out of consistency - Paying for managed search services that charge per query - Accepting mediocre search relevance because "good enough" ships faster But this is actually a solvable problem. You can realistically bring industry-standard search ranking directly into Postgres, which eliminates the need for external infra entirely. This exact solution is now available with the newly open-sourced pg_textsearch by @TigerDatabase, a Postgres extension that brings true BM25 relevance ranking into the database. BM25 is the algorithm behind Elasticsearch, Lucene, and most modern search engines. Now it runs natively in Postgres. Here's what pg_textsearch enables: - True BM25 ranking with configurable parameters (the same algorithm powering production search systems) - Simple SQL syntax: `ORDER BY content <@> 'search terms'` - Works with Postgres text search configurations for multiple languages - Pairs naturally with pgvector for hybrid keyword + semantic search That last point matters a lot for RAG apps. The video below shows this in action, and I worked with the team to put this together. You can now do hybrid retrieval (combining keyword matching with vector similarity) in a single database, without stitching together multiple systems. The syntax is clean enough that you can add relevance-ranked search to existing queries in minutes. pg_textsearch is fully open-source under the PostgreSQL license. You can find a link to their GitHub repo in the next tweet.
65
309
35
2,548
216,000
Inferential confusion
37
How to get active and sh*t: get rid of your car and walk half of your commute to work
2
48
this is one of the most important graphs that I saw in 2023 that has led to behavior change. This is in Peter Attia's book Outlive tldr: if you want to be able to climb stairs when you are 75, you need to be in the top 95th percentile of cardiovascular fitness. With this, you won't be able to run nor briskly climb stairs But if you are average/low, you may not even be able to do any of that. And it seems unlikely you'll be avg/low now (I'm in my early 40s) and then somehow go from 50th percentile to 95th. So basically it's better to get started Thus, after reading his book, I reluctantly started running again even though I hate it. And am also doing some peloton / cycling outdoors when time/weather allows cc @KatieBaynes
138
410
53
3,620
1,448,333
invader retweeted
What do 36 million people use now that eventually 5 billion will?
36 million people used the Internet in 1996. Today, there are 5 billion users.
1,649
716
417
7,049
5,090,020
So I guess we still haven't figured out how not to give large-scale murderers and thieves unlimited opportunity to become the primary topic of public conversation... We really need better edgelords.
871
949
92
8,108
invader retweeted
Don鈥檛 argue with idiots on the Internet. How do you know you鈥檙e arguing with an idiot? Because they鈥檙e arguing with idiots on the Internet.
173
1,036
109
8,483
Replying to @glenweyl @rushkoff
I've never understood the "build a bunker to escape the apocalypse" mentality. I'm not afraid of nuclear war killing *me*, I'm afraid of nuclear war killing the guy who's going to invent the life extension breakthroughs that will save my life a century from now.
105
86
18
740