Haki Profile
Haki

@be_haki

Followers
3K
Following
3K
Media
153
Statuses
2K

A software developer and a technical lead. I take a special interest in databases, web development, software design and performance tuning.

Joined September 2014
Don't wanna be here? Send us removal request.
@be_haki
Haki
29 days
Just published "How to Get Foreign Keys Horribly Wrong" in Django. Finally got a around to publishing the article that inspired my talk in DjanogCon. If you already watched / attended the talk make sure to check out that last part about FOR UPDATE NOT KEY.
hakibenita.com
Common Pitfalls and Potential Optimizations in Django
3
6
36
@be_haki
Haki
9 days
๐Ÿ†Achievement unlocked: my website is ranked number 1 for the search term "=#" . Thank you mom and dad!
Tweet media one
1
0
14
@be_haki
Haki
2 months
Just FYI, the reason timestamp is considered mutable is that this is possible:. select 'now'::timestamptz;.
1
0
0
@be_haki
Haki
2 months
Hi #PostgreSQL friends, how are you solving this problem?
Tweet media one
2
0
1
@be_haki
Haki
2 months
RT @santoshkpatro_: Just watched an amazing talk by @be_haki diving deep into the intricacies of ForeignKeys in Django ORM + PostgreSQL ๐Ÿ”๐Ÿ”ฅโ€ฆ.
0
3
0
@be_haki
Haki
2 months
What I was hoping for. I was hoping they would find the labels by clustering on the 2D points and than use the model to label the clusters - this is what I did - but they just look for the closest label which they provide in advance. Still a cool demo.
0
0
0
@be_haki
Haki
2 months
Cool thing #2. It runs in the browser. You need to to use chrome and enable unsafe-gpu, and it should download ~500MB and run the model. For me it didn't work - ran out of memory - but it's a ~5+ years old laptop. ๐Ÿคท.
1
0
0
@be_haki
Haki
2 months
Cool thing #1. The model produces vectors of length 1024 - you can't really visualize it. So they used UMAP, a dimension reduction technique that preserves the natural clustering, to reduce dimensionality to (just!) 2 and visualized using a scatter plot.
github.com
Uniform Manifold Approximation and Projection. Contribute to lmcinnes/umap development by creating an account on GitHub.
1
0
3
@be_haki
Haki
2 months
๐Ÿ‘Œ Cool demo (thanks @simonw). I recently dabbled with unsupervised topic analysis using embedding so I was curious. Here's the cool things and what I was hoping for ๐Ÿ‘‡.
@xenovacom
Xenova
2 months
These models can be used for document retrieval, RAG, classification, clustering, sentiment analysis, code search, and much more! ๐Ÿš€. Links:.- Collection: - ONNX weights: - Demo:
1
1
5
@be_haki
Haki
3 months
We ended us setting `acks_late=False` and taking note that to "kill" a running Celery task we should probably use `revoke` instead. So now you know. .
0
0
1
@be_haki
Haki
3 months
When `ack_late=True` the task is acknowledged only *after* it is executed. This is usually what you want. However, if a task is killed in the middle, Celery treats it as if it was never executed, therefore, even if `max_retries=0`, it will attempt it again!.
1
0
0
@be_haki
Haki
3 months
We knew that this task can be problematic so we defined it with `max_retries=0`. so, why was it picked up again by Celery after we killed it?. Well. .
1
0
0
@be_haki
Haki
3 months
A couple of hours later this happens again (in middle of the night!) Celery gets OOM killed by the OS and systemd fails to restart it. Tasks accumulate in Redis and memory usage increases until it reaches its limit and stops accepting requests. Only restarting the services helps.
1
0
0
@be_haki
Haki
3 months
Someone triggers a Celery task that executes a big bulk update. The task consumes a lot of resources which interfere with the live system. A developer notices and kills the Celery worker using SIGTERM (after SIGKILL doesn't work). The task dies and things go back to.
1
0
0
@be_haki
Haki
3 months
I recently got bit by Celery `acks_late`. Here is how it went down and what you should know so it won't happen to you too. ๐Ÿ‘‡.
2
3
13
@be_haki
Haki
4 months
Good read by @pert5432 on the effect of column order on mview refresh time (x4, surprising. ). Also includes a walk-through of how PG actually performs refresh - definitely not what I thought!. Via @pgMustard ๐Ÿ‘.
pert5432.com
0
0
9
@be_haki
Haki
5 months
*every* *single* *time*. ๐Ÿ˜”
Tweet media one
3
0
21
@be_haki
Haki
6 months
Cool idea by one of my teammates - add a test to check that there are no pending migrations ๐Ÿ‘Œ๐Ÿ‘Œ๐Ÿ‘Œ . If there are pending migrations we forgot to generate, it fails with the output of `makemigrations --check`.
Tweet media one
Tweet media two
2
0
10
@be_haki
Haki
6 months
I'm giving a talk this year in DjangoCon in Dublinโ˜˜๏ธ! . I'm going to talk about concurrency issues, implicit behavior and lesser known gotchas with FKs in Django. You're going to laugh, you're going to cry,you're going to say "Hell! how did we not know that". RT if you're goingโ˜˜๏ธ.
@DjangoConEurope
DjangoCon Europe
6 months
๐ŸŽ™๏ธย TALK: How to get Foreign Keys horribly wrong in Django by Haki Benita. ๐ŸŽŸ๏ธย Grab your ticket: #djangoconeurope #python #django #conference #talk
Tweet media one
0
0
17
@be_haki
Haki
7 months
๐ŸŽ™๏ธI'm giving a talk this Monday on advanced indexing technics to make your database faster and more efficient. You are welcome! . Free โ€ข Online โ€ข English โ€ข Monday, February 3, 2025.7:30 PM to 9:30 PM CET .
Tweet card summary image
meetup.com
Speaker: [Haki Benita](https://hakibenita.com/) Host: [Gabor Szabo](https://www.linkedin.com/in/szabgab/) Location: Zoom Language: English Developers who are not familiar
0
4
18