Better HN
topnewbestaskshowjobs
Log inSign up

haki

553 karma · joined Jan 1, 2014 (12y ago) · 36 submissions

Submissions

1.

Row Locks with Joins Can Produce Surprising Results in PostgreSQL(hakibenita.com ↗)

3 points · by haki · 9mo ago · 1 comment

comment 9mo ago · link · parent

Some 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...

3.

Unconventional PostgreSQL Optimizations(hakibenita.com ↗)

431 points · by haki · 10mo ago · 69 comments

4.

Reliable Django Signals(hakibenita.com ↗)

2 points · by haki · 1y ago · discuss

comment 1y ago · link · parent

See psycopg Identifier for binding table names

https://www.psycopg.org/psycopg3/docs/api/sql.html#psycopg.s...

comment 2y ago · link · parent

Since at least two people noticed, I would just say that the insert-select-insert approach was added later, after I took some inspiration from Django's implementation of get_or_create.

comment 3y ago · link · parent

If you store large jsonb values in the database, storing them out of line may be a good thing - for example, you can query metadata much faster.

Also, worth mentioning that jsonb is only benefitial when you plan on indexing/manipulating the data in the database. Otherwise, using json type may be a better choice (smaller size, stored as text, parsed on demand)

comment 3y ago · link · parent

I used excalidraw.com

9.

Heroku has been running a second copy of my scheduler instance(openfolder.sh ↗)

297 points · by haki · 3y ago · 128 comments

comment 3y ago · link · parent

You can utilize transactional DDL for that

https://hakibenita.com/sql-tricks-application-dba#make-index...

comment 5y ago · link · parent

I'm always looking for new copy tricks. Is "copy" a temporary table? Or a variable...?

12.

Practical SQL for Data Analysis: What you can do without Pandas(hakibenita.com ↗)

2 points · by haki · 5y ago · discuss

13.

New Features in Django 3.2(hakibenita.com ↗)

47 points · by haki · 5y ago · 13 comments

14.

An unexpected find that freed 20GB of unused index space in PostgreSQL(hakibenita.com ↗)

375 points · by haki · 5y ago · 78 comments

15.

Re-Introducing Hash Indexes in PostgreSQL(hakibenita.com ↗)

12 points · by haki · 5y ago · discuss

comment 5y ago · link · parent

See relevant section in the article:

https://hakibenita.com/python-mypy-exhaustive-checking#the-f...

17.

Exhaustiveness Checking in Python Using Mypy(hakibenita.com ↗)

2 points · by haki · 5y ago · 1 comment

18.

The surprising impact of medium-size texts on PostgreSQL performance(hakibenita.com ↗)

182 points · by haki · 6y ago · 16 comments

comment 6y ago · link · parent

Starting at PostgreSQL 12 you don't even have to feel bad about all of those CTE's.

20.

Simple Anomaly Detection Using Plain SQL(hakibenita.com ↗)

6 points · by haki · 6y ago · 2 comments

comment 6y ago · link · parent

See this

https://hakibenita.com/fast-load-data-python-postgresql

22.

Some SQL Tricks of an Application DBA(hakibenita.com ↗)

5 points · by haki · 6y ago · discuss

23.

Stop Using Datetime.now in Python(hakibenita.com ↗)

2 points · by haki · 6y ago · 1 comment

24.

Understand Group by in Django with SQL(hakibenita.com ↗)

1 points · by haki · 6y ago · discuss

25.

Common Mistakes and Missed Optimization Opportunities in SQL(hakibenita.com ↗)

179 points · by haki · 7y ago · 66 comments

26.

“Export to Excel” Almost Killed Our System(hakibenita.com ↗)

2 points · by haki · 7y ago · discuss

12