frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Updates on GNU/Hurd progress [video]

https://fosdem.org/2026/schedule/event/7FZXHF-updates_on_gnuhurd_progress_rump_drivers_64bit_smp_...
1•birdculture•1m ago•0 comments

Epstein took a photo of his 2015 dinner with Zuckerberg and Musk

https://xcancel.com/search?f=tweets&q=davenewworld_2%2Fstatus%2F2020128223850316274
1•doener•1m ago•0 comments

MyFlames: Visualize MySQL query execution plans as interactive FlameGraphs

https://github.com/vgrippa/myflames
1•tanelpoder•2m ago•0 comments

Show HN: LLM of Babel

https://clairefro.github.io/llm-of-babel/
1•marjipan200•2m ago•0 comments

A modern iperf3 alternative with a live TUI, multi-client server, QUIC support

https://github.com/lance0/xfr
1•tanelpoder•4m ago•0 comments

Famfamfam Silk icons – also with CSS spritesheet

https://github.com/legacy-icons/famfamfam-silk
1•thunderbong•4m ago•0 comments

Apple is the only Big Tech company whose capex declined last quarter

https://sherwood.news/tech/apple-is-the-only-big-tech-company-whose-capex-declined-last-quarter/
1•elsewhen•7m ago•0 comments

Reverse-Engineering Raiders of the Lost Ark for the Atari 2600

https://github.com/joshuanwalker/Raiders2600
2•todsacerdoti•9m ago•0 comments

Show HN: Deterministic NDJSON audit logs – v1.2 update (structural gaps)

https://github.com/yupme-bot/kernel-ndjson-proofs
1•Slaine•12m ago•0 comments

The Greater Copenhagen Region could be your friend's next career move

https://www.greatercphregion.com/friend-recruiter-program
1•mooreds•13m ago•0 comments

Do Not Confirm – Fiction by OpenClaw

https://thedailymolt.substack.com/p/do-not-confirm
1•jamesjyu•13m ago•0 comments

The Analytical Profile of Peas

https://www.fossanalytics.com/en/news-articles/more-industries/the-analytical-profile-of-peas
1•mooreds•13m ago•0 comments

Hallucinations in GPT5 – Can models say "I don't know" (June 2025)

https://jobswithgpt.com/blog/llm-eval-hallucinations-t20-cricket/
1•sp1982•14m ago•0 comments

What AI is good for, according to developers

https://github.blog/ai-and-ml/generative-ai/what-ai-is-actually-good-for-according-to-developers/
1•mooreds•14m ago•0 comments

OpenAI might pivot to the "most addictive digital friend" or face extinction

https://twitter.com/lebed2045/status/2020184853271167186
1•lebed2045•15m ago•2 comments

Show HN: Know how your SaaS is doing in 30 seconds

https://anypanel.io
1•dasfelix•15m ago•0 comments

ClawdBot Ordered Me Lunch

https://nickalexander.org/drafts/auto-sandwich.html
3•nick007•16m ago•0 comments

What the News media thinks about your Indian stock investments

https://stocktrends.numerical.works/
1•mindaslab•17m ago•0 comments

Running Lua on a tiny console from 2001

https://ivie.codes/page/pokemon-mini-lua
1•Charmunk•18m ago•0 comments

Google and Microsoft Paying Creators $500K+ to Promote AI Tools

https://www.cnbc.com/2026/02/06/google-microsoft-pay-creators-500000-and-more-to-promote-ai.html
2•belter•20m ago•0 comments

New filtration technology could be game-changer in removal of PFAS

https://www.theguardian.com/environment/2026/jan/23/pfas-forever-chemicals-filtration
1•PaulHoule•21m ago•0 comments

Show HN: I saw this cool navigation reveal, so I made a simple HTML+CSS version

https://github.com/Momciloo/fun-with-clip-path
2•momciloo•22m ago•0 comments

Kinda Surprised by Seadance2's Moderation

https://seedanceai.me/
1•ri-vai•22m ago•2 comments

I Write Games in C (yes, C)

https://jonathanwhiting.com/writing/blog/games_in_c/
2•valyala•22m ago•0 comments

Django scales. Stop blaming the framework (part 1 of 3)

https://medium.com/@tk512/django-scales-stop-blaming-the-framework-part-1-of-3-a2b5b0ff811f
1•sgt•22m ago•0 comments

Malwarebytes Is Now in ChatGPT

https://www.malwarebytes.com/blog/product/2026/02/scam-checking-just-got-easier-malwarebytes-is-n...
1•m-hodges•22m ago•0 comments

Thoughts on the job market in the age of LLMs

https://www.interconnects.ai/p/thoughts-on-the-hiring-market-in
1•gmays•23m ago•0 comments

Show HN: Stacky – certain block game clone

https://www.susmel.com/stacky/
3•Keyframe•26m ago•0 comments

AIII: A public benchmark for AI narrative and political independence

https://github.com/GRMPZQUIDOS/AIII
1•GRMPZ23•26m ago•0 comments

SectorC: A C Compiler in 512 bytes

https://xorvoid.com/sectorc.html
2•valyala•27m ago•0 comments
Open in hackernews

SQL Design Patterns (2010)

https://vadimtropashko.wordpress.com/%e2%80%9csql-design-patterns%e2%80%9d-book/about/
151•mci•5mo ago

Comments

potatoproduct•5mo ago
Not ashamed to admit that I never really thought about the distinct operator 'being redundant' as its essentially just a group by.
morkalork•5mo ago
distinct has always felt like a query smell to me. Too many junior analysts abusing it because they don't know the schema well and are over-joining entities
dspillett•5mo ago
DISTINCT is often a smell at the head (or middle) of a complex query as you are throwing away processed information, sometimes a lot of it, late in the game. Much better to filter it out earlier and not process it further, where possible. Filtering earlier, as well as reducing waste processing time (and probably memory use), increases the chance of the query planner being able to use an index for the filter which could greatly decrease the IO cost of your query.
ryanjshaw•5mo ago
Sometimes the number of joins is fine but they don’t understand the data properly and should be spending more time understanding why multiple rows are being returned when they expect one (eg they need to filter on an additional field).

I wish SQL had a strict mode syntax that forces you to use something like `select one` (like LINQ’s Single()) or `select many` to catch these kinds of bugs.

stevage•5mo ago
Huh, I have always just thought of it as a syntactic shortcut.
paulddraper•5mo ago
SELECT DISTINCT is often a code smell. (Not always.) If you see it, there’s a 70% chance it got slapped on to fix an issue that should have been solved a different way.

SELECT DISTINCT ON is different, and useful.

aspaviento•5mo ago
I had a teacher who had specific rules for exams when we wrote SQL statements:

- For a question worth 2 points, if you use the word "DISTINCT" when it wasn't needed, you lose 0.5 points.

- If you don't use "DISTINCT" when it was necessary, you lose all 2 points.

9dev•5mo ago
Oh yes, introducing a little game theory anxiety into exam questions sounds like a wonderful little torturing tool!
jslaby•5mo ago
Of course, trying out the first example doesn't work on SQL Server..
datadrivenangel•5mo ago
"We use Oracle syntax and write <column expr> <alias> instead of ANSI SQL <column expr> AS <alias>. Ditto for table expressions"

Footnote on page 3.

jslaby•5mo ago
T-SQL can handle that alias expr just fine, but the seqNum returned is 4,8,12,16,20 instead of the 1,2,3... I tried on MySQL and it works fine. I'm not sure how SQL Server is handling those cartesian joins differently
alphazard•5mo ago
I always tell people to worry about the data structures that you want the database to maintain for you, and not worry about the SQL. You can always use Google to look up the SQL, or now ChatGPT to generate it for you. SQL is a not-that-great language and it intentionally hides what's going on. It is also different enough between databases that you need to pay attention. So learning to design/think in terms of SQL is probably not worth doing.

The set of data structures that you use to model and index a dataset is worth understanding, and designing in that space is a skill worth learning.

yakshaving_jgt•5mo ago
For posterity, how would you recommend the average working programmer should go about doing that?
ryanjshaw•5mo ago
Read code from other projects
alphazard•5mo ago
An intro data structures course is worth watching if you haven't taken one. There are plenty of them on YouTube. Try to follow along with a language that has an explicit pointer type. Go is a good choice. Java and Python are worse choices (for this particular thing) IMO.

Assuming you are familiar with trees and hashmaps, you have all the important building blocks. You can imagine a database as a bunch of trees, hashmaps and occasionally other stuff, protected by a lock. First you acquire the lock, then you update some of the data structures, and maybe that requires you to update some of the other data structures (like indexes) for consistency. Then you release the lock.

By default, most data will live in a BTree with an integer primary key, and that integer is taken from a counter that you increment for new inserts. Indexes will be BTrees where the key is stuff you want to query on, and the value is the primary key in the main table.

Using just those data structures you should be able to plan for any query or insert pattern. It helps to figure this out yourself in a programming language for a few practice cases, so you know you can do it. Eventually it will be easy to figure out what tables and indexes you need in your head. In the real world, this stuff is jotted down in design docs, often as SQL or even just bullets.

That's really all you need, and that's where I recommend getting out of the rabbit hole. Query planners are pretty good. You can usually just write SQL and if you did the work to understand what the tables and indexes should be, the planner will figure out how to use them to make the query fast.

belfthrow•5mo ago
Java is a bad language for this compared to go? Is this legitimate advice on a serious programming blog. Pretty unbelievable honestly.
sgarland•5mo ago
Frankly, this is terrible advice. If you’re not designing your data model around the language it’s going to be queried in, how do you expect to get decent performance out of the database?

Also, in no way does SQL hide anything - it’s a declarative language, and will produce exactly what you tell it to, provided you understand what it is you asked it to do. The query engine is somewhat of a black box, but that is completely orthogonal.

paulddraper•5mo ago
SQL is a declarative language so it —- by definition —- hides the execution.

Not really sure what you’re trying to argue here.

sgarland•5mo ago
Parent made it sound - to me - that you put an input in and hope for the best. If you understand the operators, you can quite confidently predict an output given an input.
halfcat•5mo ago
> If you understand the operators

That’s the point. In an imperative language if you don’t yet understand (or make a typo, or whatever), you can just print/console.log and find out.

I’ve seen junior devs, data analysts, and LLMs spin their wheels trying to figure out why adding a join isn’t producing the output they want. I don’t think they would figure it out using SQL alone if you gave them a month.

SkiFire13•5mo ago
The equivalent of `print`/`console.log` in SQL would be using subqueries/CTE and run them to see the intermediate result (just like `print`/`console.log` show you intermediate results of the executions in an imperative language).
sgarland•5mo ago
Then you back off, and go back to first principles. Create the minimum example of the problem, and as a sibling comment mentioned, break it down to its constituent parts and observe what happens in each.
crazygringo•5mo ago
You missed the "performance" part.

Depending on how you write your query and how you structure your data, a query can take 0.005 seconds or 500 seconds.

SQL hiding the execution is an extremely leaky abstraction. To get the performance you need, you have to plan your possible queries in advance together with how to structure the data.

I mean, it doesn't matter if you only have 100 rows per table, but once you're dealing with multiple tables with millions of rows each it's everything.

greekrich92•5mo ago
If you use bubblesort instead of quicksort it will take longer as well. Knowing the language and understanding the schema solves this.
teh_klev•5mo ago
>hides the execution.

But you're not prevented from finding out how your query was executed. For example EXPLAIN (MySQL, Postgres) or query analyser for MSSQL.

chasil•5mo ago
> Also, in no way does SQL hide anything - it’s a declarative language, and will produce exactly what you tell it to.

Ha ha, no, SQL implementations can conform to the standard in unexpected ways.

NULL = NULL

Is that true or false? We didn't know until 2003.

https://en.wikipedia.org/wiki/Null_(SQL)#Criticisms

gfody•5mo ago
that's not true or false it's null
sgarland•5mo ago
Considering that all implementations I’m aware of have evaluated that expression to NULL, this isn’t a very pragmatic example. NULL is unknown, and every type has it as a possibility.

The SQL2003 changes were more about how constraints should treat NULL than anything intrinsic about NULL itself.

awesome_dude•5mo ago
I don't get this - my database is going to be normalised to whatever is optimal (3rd normal form generally, denormalised for higher load/sharded/caching)

The indexing is where the main optimisations take place - hashmap indexes, or clustering indexes for priority queues.

What am I missing?

baq•5mo ago
You’re kinda right, but designing for a particular RDBMS with awareness of queries which will be performed thus indexes necessary (…or not ;) is really not that far away from what you propose. The only issue is beginner SQL learning material says ‘it’s declarative, don’t worry about what’s happening as long as you get a good result’ and that just isn’t true in any non-trivial applications of SQL.
dspillett•5mo ago
This is rather old and there are better ways of doing most of these things now. For instance the counting example would usually be much more efficient performed using the ROW_NUMBER() window function instead of a Cartesian product. When you can remove a cross product from your process it is almost always beneficial to do so. That will often involve introducing a CTE⁰¹ which might put off some beginners²³, but it shouldn't as this sort of example is pretty simple (you aren't worrying about any recursive case).

----

[0] Because you want the ordinal of the row in the input table/view, not your output.

[1] You could also use a sub-query, in most cases a good query planner will see the equivalence and do the same thing for either. The CTE option is easier to read and maintain IMO.

[2] In databases, like sports, CTEs can result in headaches!

[3] Or veterans of postgres, where until a few years ago CTEs were an optimisation gate, blocking predicate push-down and making some filtered queries a lot more expensive (though often no more so than the naive Cartesian product method).

phartenfeller•5mo ago
SQL is beautiful in its own way. Definitely not easy to master but beautiful in how much business logic you can implement in not many lines of code.

And with SQL macros becoming a thing it is now easily possible to store patterns as reausable functions with parameters.