Top all-time · #1303
Haki Benita
Personal blog · hakibenita.comprogrammingdata
Haki Benita's personal blog at hakibenita.com covers programming and data. Since 2019, 53 different Hacker News readers have linked it 86 times, most often “Practical SQL for Data Analysis”. It is still writing: the last post was on 2026-07-08, and you can follow it by feed.
Too few sampled comments (18) to say how often HN recommends it.?
Why HN links it
Haki Benita writes about PostgreSQL, SQL performance, and Python/Django. Commenters link posts on Postgres features, slow Django REST serialization, CTEs, and Python dependency injection.
- Recommended for · 6 comments
- Called a 'beautiful article' on DRF serializer speed and a 'very helpful' explanation of Python dependency injection.
Summarised by Claude from a sample of 18 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
The writings of Haki Benita
Most-linked posts?
- Practical SQL for Data Analysis6 people · 6 mentions · first linked 2021-04-26
- Simple Anomaly Detection Using Plain SQL6 people · 6 mentions · first linked 2020-09-21
- Improve Serialization Performance in Django Rest Framework5 people · 5 mentions · first linked 2019-06-09
- Fastest Way to Read Excel in Python4 people · 4 mentions · first linked 2024-01-03
- Re-Introducing Hash Indexes in PostgreSQL4 people · 4 mentions · first linked 2021-01-11
- The surprising impact of medium-size texts on PostgreSQL performance4 people · 4 mentions · first linked 2020-10-20
- Some SQL Tricks of an Application DBA4 people · 4 mentions · first linked 2020-07-27
- Handling Concurrency Without Locks3 people · 4 mentions · first linked 2022-06-09
- Fast Way to Load Data into PostgreSQL Using Python3 people · 4 mentions · first linked 2019-07-09
- Lesser-known Postgres features3 people · 3 mentions · first linked 2021-11-08
What Hacker News says?
The feed is here: https://hakibenita.com/feeds/all.atom.xml .
Comment linking /feeds/all.atom.xml
on “Lesser-known Postgres features”Submitted Lesser-known Postgres features as a story · 702 points
HN discussionI want to stress the importance of not using id int SERIAL If you are on a somewhat recent version of postgres, please do yourself a favor and use: id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY An "identity column", the part here: https://hakibenita.com/postgresql-unknown-features#prevent-s... You might think this is trivial -- but SERIAL creates an "owned" (by a certain user) sequence behind the scenes, and s…
Comment linking /postgresql-unknown-features
on “Lesser-known Postgres features”Submitted Practical SQL for Data Analysis as a story · 602 points
HN discussionOP has a pretty interesting writeup about why DRF model serialization is slow. https://hakibenita.com/django-rest-framework-slow
Comment linking /django-rest-framework-slow
on “FastAPI framework, high perf, easy to learn, fast to code, ready for production”Submitted Simple Anomaly Detection Using Plain SQL as a story · 512 points
HN discussionCTE advice is somewhat questionable, as it is database specific. CTEs were for a very long time an optimization fence in PostgreSQL, were not inlined and behaved more like temporary materialized views. Only with release of PostgreSQL 12 some CTE inlining is happening - with limitations: not recursive, no side-effects and are only referenced once in a later part of a query. Mode info: https://hakibenita.com/be-carefu…
Comment linking /be-careful-with-cte-in-postgre-sql
on “Best practices for writing SQL queries”Submitted An unexpected find that freed 20GB of unused index space in PostgreSQL as a story · 375 points
HN discussionHe actually mentioned index de-duplication earlier: https://hakibenita.com/postgresql-unused-index-size#activati... If I had to guess, I would say that it doesn't accomplish anything (or as much as you'd think) for null values simply because there is no real data to store in either approach, you just have a bunch of pointers either way.
Comment linking /postgresql-unused-index-size
on “An unexpected find that freed 20GB of unused index space in PostgreSQL”Submitted Some SQL Tricks of an Application DBA as a story · 327 points
HN discussionHere is an another article that expands on how Postgres stores text data. https://hakibenita.com/sql-medium-text-performance
Comment linking /sql-medium-text-performance
on “How PostgreSQL stores rows”Submitted Fast Way to Load Data into PostgreSQL Using Python as a story · 246 points
HN discussionSee this https://hakibenita.com/fast-load-data-python-postgresql
Comment linking /fast-load-data-python-postgresql
on “Some SQL Tricks of an Application DBA”Submitted The surprising impact of medium-size texts on PostgreSQL performance as a story · 182 points
HN discussionLately, I've been studying machine learning, from point zero, with a focus on time series analysis. Two months in already completed a course on Python and another book on Pandas, several hundreds of hours later in the fourth chapter in a book I paid for on deep learning and time series analysis they provided me with the most important information I needed: there is no evidence deep learning works better than traditi…
Comment linking /sql-for-data-analysis
on “TimescaleDB raises $40M”Submitted Common Mistakes and Missed Optimization Opportunities in SQL as a story · 179 points
HN discussionOld is a harsh word, maybe mature would be a better fit, not everything new and shiny is gold, and yet not everything old sucks. Not arguing here about types and Pydantic being faster than the built in ModelSerializers. However, for serializer speed improvements and performance in DRF I would advise dropping ModelSerializers and either going for Serializers or plain dict. Haki Benita has a beautiful article on that…
Comment linking /django-rest-framework-slow
on “Modern JavaScript for Django developers”Submitted How to Get or Create in PostgreSQL as a story · 103 points
HN discussionYou might be interested in https://hakibenita.com/django-rest-framework-slow . If you weren't able to update to a 3.x version that has https://github.com/django/django/commit/a2c31e12da272acc76f3... , this might have bit you pretty hard.
Comment linking /django-rest-framework-slow
on “Django Async: What's new and what's next?”Submitted Exhaustiveness Checking with Mypy as a story · 85 points
HN discussionI don't know if it's the same for MySQL, but in Postgres a CTE would possibly force the planner to make less efficient choices [1]. Would be interesting if someone who knows more than me could clarify on this [1] https://hakibenita.com/be-careful-with-cte-in-postgre-sql
Comment linking /be-careful-with-cte-in-postgre-sql
on “Faster offset pagination for Rails apps”Submitted How to Get Foreign Keys Horribly Wrong as a story · 68 points
HN discussionSee relevant section in the article: https://hakibenita.com/python-mypy-exhaustive-checking#the-f...
Comment linking /python-mypy-exhaustive-checking
on “Exhaustiveness Checking with Mypy”Submitted New Features in Django 3.2 as a story · 47 points
HN discussionSo many - I'm going to share a few that come to mind quickly, rather than agonizing over picking the best possible results. Tim Bray: https://www.tbray.org/ongoing/ Julia Evans: https://jvns.ca/ Tom MacWright: https://macwright.com/ Jacob Kaplan-Moss: https://jacobian.org/ Lea Verou: https://lea.verou.me/ Will Larson: https://lethain.com/featured/ Camille Fournier: https://skamille.medium.com/ Haki Benita: https://h…
Comment linking /
on “Ask HN: What are the blogs from which you learned most”Submitted Re-Introducing Hash Indexes in PostgreSQL as a story · 12 points
HN discussionSome a prime example of a service that naturally peaks at round hours. We have a habbit of never scheduling long running processes at round hours. Usually because they tend to be busier. https://hakibenita.com/sql-tricks-application-dba#dont-sched...
Comment linking /sql-tricks-application-dba
on “Postgres Postmaster does not scale”Submitted Handling Concurrency Without Locks as a story · 7 points
HN discussionI found this explanation very helpful: https://hakibenita.com/python-dependency-injection (if you program in Python)
Comment linking /python-dependency-injection
on “Ask HN: Concepts that clicked only years after you first encountered them?”Submitted Re-Introducing Hash Indexes in PostgreSQL as a story · 7 points
HN discussion