frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Mini NASes marry NVMe to Intel's efficient chip

https://www.jeffgeerling.com/blog/2025/mini-nases-marry-nvme-intels-efficient-chip
167•ingve•3h ago•70 comments

LLMs caused drastic vocabulary shift in biomedical publications

https://www.science.org/doi/10.1126/sciadv.adt3813
46•em3rgent0rdr•59m ago•12 comments

EverQuest

https://www.filfre.net/2025/07/everquest/
73•dmazin•3h ago•24 comments

How to Incapacitate Google Tag Manager and Why You Should (2022)

https://backlit.neocities.org/incapacitate-google-tag-manager
23•fsflover•1h ago•5 comments

Why I left my tech job to work on chronic pain

https://sailhealth.substack.com/p/why-i-left-my-tech-job-to-work-on
215•glasscannon•6h ago•135 comments

Compression Dictionary Transport

https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Compression_dictionary_transport
46•todsacerdoti•4h ago•4 comments

Kepler.gl

https://kepler.gl/
82•9woc•5h ago•10 comments

Eight dormant Satoshi-era Bitcoin wallets reactivated after 14 yrs

https://twitter.com/WatcherGuru/status/1941167512491864554
29•amrrs•34m ago•12 comments

Show HN: I AI-coded a tower defense game and documented the whole process

https://github.com/maciej-trebacz/tower-of-time-game
145•M4v3R•6h ago•86 comments

Larry (cat)

https://en.wikipedia.org/wiki/Larry_(cat)
188•dcminter•9h ago•43 comments

UpCodes (YC S17) is hiring a Head of Ops to automate construction compliance

https://up.codes/careers?utm_source=HN
1•Old_Thrashbarg•2h ago

Writing a Game Boy Emulator in OCaml

https://linoscope.github.io/writing-a-game-boy-emulator-in-ocaml/
187•ibobev•9h ago•31 comments

Air Pollution May Contribute to Development of Lung Cancer in Never-Smokers

https://today.ucsd.edu/story/air-pollution-may-contribute-to-development-of-lung-cancer-in-never-smokers-new-study-finds
6•gmays•44m ago•1 comments

Bcachefs may be headed out of the kernel

https://lwn.net/Articles/1027289/
53•ksec•5h ago•47 comments

Is an Intel N100 or N150 a better value than a Raspberry Pi?

https://www.jeffgeerling.com/blog/2025/intel-n100-better-value-raspberry-pi
200•transpute•7h ago•177 comments

ChatGPT creates phisher's paradise by serving the wrong URLs for major companies

https://www.theregister.com/2025/07/03/ai_phishing_websites/
17•josephcsible•45m ago•0 comments

``Free as Air, Free as Water, Free as Knowledge'' (1992)

http://bactra.org/Sterling/Free_as_the_Air_Free_as_Water_Free_as_Knowledge.html
9•whoopdedo•3d ago•0 comments

Lens: Lenses, Folds and Traversals

https://hackage.haskell.org/package/lens
51•hyperbrainer•3d ago•17 comments

Can Large Language Models Play Text Games Well?

https://arxiv.org/abs/2304.02868
44•willvarfar•7h ago•29 comments

Show HN: BunkerWeb – the open-source and cloud-native WAF

https://docs.bunkerweb.io/latest/
67•bnkty•7h ago•25 comments

Gremllm

https://github.com/awwaiid/gremllm
12•andreabergia•2h ago•3 comments

Wind Knitting Factory

https://www.merelkarhof.nl/work/wind-knitting-factory
197•bschne•22h ago•54 comments

In a milestone for Manhattan, a pair of coyotes has made Central Park their home

https://www.smithsonianmag.com/science-nature/in-a-milestone-for-manhattan-a-pair-of-coyotes-has-made-central-park-their-home-180986892/
86•sohkamyung•3d ago•79 comments

A Rust-TypeScript integration

https://github.com/beeeeep54/rust-typescript
41•wreedtyt•7h ago•44 comments

Zig breaking change – initial Writergate

https://github.com/ziglang/zig/pull/24329
166•Retro_Dev•15h ago•179 comments

The Novelty of the Arpanet

https://twobithistory.org/2021/02/07/arpanet.html
3•xk3•3d ago•0 comments

Show HN: A cross-platform terminal emulator written in Java

https://github.com/sebkur/forceterm
46•sebkur•3d ago•7 comments

Rust and WASM for Form Validation

https://sebastian.lauwe.rs/blog/rust-wasm-form-validation/
34•slau•6h ago•15 comments

Killer whales groom each other with pieces of kelp

https://www.science.org/content/article/killer-whales-groom-each-other-pieces-kelp
74•noleary•3d ago•42 comments

Logging Shell Commands in BusyBox? Yes, You Can Now

http://carminatialessandro.blogspot.com/2025/06/logging-shell-commands-in-busybox-yes.html
10•acarminati•3d ago•0 comments
Open in hackernews

How often is the query plan optimal?

https://vondra.me/posts/how-often-is-the-query-plan-optimal/
25•eatonphil•4d ago

Comments

alexisread•3d ago
TBH this is a good case for Linq-style queries, over SQL-based ones. Linq style allows you to narrow the query deterministically vs Sql eg. Mytable1.select().where().join(mytable2)

This applies the filter before the join, compared with:

Select from mytable1 join mytable2 on... Where...

Which relies on the query plan to resolve the correct application of where, and hope it puts the where before the join.

This becomes more important in the cloud, where Iceberg tables cannot be benchmarked in the same way as single-cluster relational DBs.

brudgers•1d ago
When you are willing to pay for your RDBMS, you are likely to get an optimizer that does algebra for you (and does algebra pretty well).

On the other hand, if you are hand coding the query, you are hand coding whether you use SQL, Linq, or anything else. And a strength of SQL is a robust ecosystem of documentation, tools, employment candidates, and consultants.

gigatexal•7h ago
exactly, one often gets what they pay for.

databases are complicated beasts and tens of thousands if not more working years of the smartest people have been working on them since the 70s

hyperpape•5h ago
> databases are complicated beasts and tens of thousands if not more working years of the smartest people have been working on them since the 70s

Yes, but they've also set themselves a much harder problem. Instead of "find the proper execution for this particular query, armed with all the knowledge of the database you have" they have the problem of "find the proper execution for all possible queries, using only information that's encoded in DB statistics."

So it's no surprise that it's quite easy to find places the optimizer does silly things. To take one instance that bit me recently: or clauses representing different tables cannot be optimized well at all in postgres (https://www.cybertec-postgresql.com/en/avoid-or-for-better-p...).

I'd still rather have optimizers than not--the optimizer does well most of the time, and my current work has far too many queries to hand-optimize. But you do end up seeing a lot of poorly optimized queries.

gigatexal•1h ago
That’s right. The better one is able to help the optimizer the better life is. It’s an art not a science.
gigatexal•7h ago
but SQL execution even in a dumb planner is FROM then WHERE then .... and then finally SELECT and ORDER

so I don't get it

gonzalohm•6h ago
But a smart query planner would move the where condition into the JOIN condition
Sesse__•6h ago
Depending on the join type, moving it up into the join (instead of keeping it on the table) would be either irrelevant or actively harmful.
hobofan•7h ago
Both SQL and Linq-style queries end up in the same in-memory representation once they hit the query engine/query planner.

Filter pushdown ("correct application of where, and hope it puts the where before the join") is table stakes for a query planner and has been for decades.

And no, Iceberg tables are not special in any way here. Iceberg tables contain data statistics, just like the ones described in the article to make the optimizer choose the right query plan.

Sesse__•5h ago
Filter pushdown is surprisingly subtle, when you start getting into issues of non-inner joins and multiple equalities. I had no idea until I had to implement it myself. (It's also not always optimal, although I don't offhand know of any optimizer that understands the relevant edge cases.)
adamzochowski•6h ago
This depends on the join type.

    select ...
    from table1 
        left join mytable2 on ... 
    where ..
If you move contents of where clause to the join/on clause, you will change meaning of the query.

If someone has a complex query or complex performance, they could do either subselects

    select ...
    from ( select ... from table1 where ... ) as table1_filtered
        inner join mytable2 on ... 

or CTEs

    with table1_filtered as ( select ... from table1 where ... ) 
    select ...
    from table1_filtered
        inner join mytable2 on ...
remus•6h ago
An interesting article, but I disagree with the first sentence.

> The basic promise of a query optimizer is that it picks the “optimal” query plan.

This is kind of true, but the optimiser has to do all this with very tight constraints on available time and resources. A planner that returned a perfect plan every time would be useless if it took 500ms and 500mb, so I'd say a better phrasing would be

> The basic promise of a query optimizer is that it picks a good plan most of the time and does it quickly and efficiently.

wat10000•5h ago
I imagine that finding the optimal query plan would itself be at least NP-complete in the worst case, so you’ll definitely want to settle for “good” rather than optimal.
marcosdumay•4h ago
> The basic promise of a query optimizer is that it picks a good plan most of the time and does it quickly and efficiently.

Hum, no. The basic promise of a query optimizer is that it picks a good plan all of the time. Otherwise it's worse than useless and you would be better with a DB where you can pin the plan for every query.

But yes, the goal is on "good", not "optimal".

RaftPeople•2h ago
> The basic promise of a query optimizer is that it picks a good plan all of the time.

The poster you responded to is correct, it's a combinatorial problem that can't be expected to pick a good plan all of the time within the normal data and time constraints.

bob1029•6h ago
> Is there a plausible way to improve this?

Yes. There are techniques in high end RDBMS like adaptive query processing which allow for the engine to update its approach during execution.

https://learn.microsoft.com/en-us/sql/relational-databases/p...

https://www.ibm.com/docs/en/i/7.6.0?topic=overview-adaptive-...

https://apex.oracle.com/pls/apex/features/r/dbfeatures/featu...

mike_hearn•5h ago
Stats based query planning is really useful for ad-hoc queries where you don't care exactly how fast it runs, you just want it to be as fast as possible with as little thought put into the query as possible. Given that originally SQL was meant to be used by humans, its dependence on planners makes sense.

For queries issued by machines where predictability is the most important thing, it probably makes sense to hard-code plans or at least pin a plan so it can't change out from underneath you at midnight in production. I'm not sure about Postgres, but you can do this on Oracle DB. There's probably a better way to express schemas in which both indexing and plans can be constructed ahead of time in many cases where the developer already knows the likely distribution of data, and not having performance cliffs is more important than the convenience of the planner. Example:

@Entity class SomeTable { @Mostly("SUCCESSFUL", "FAILED") SomeEnum row; }

and then the DB mapper - not necessarily an ORM - could provide the query hints needed to force the DB onto a reasonable plan for the annotated distribution.

williamdclt•5h ago
> I'm not sure about Postgres

Not possible. It’s explicitly a non-goal, sub-optimal plans are considered a bug to be fixed, you can’t even force the use of an index.

To their credit, the Postgres query planner is amazing and does generally work very well that you don’t need forcing indexes or plans. But that’s little comfort when it does not and you have a production incident on your hands

Edit: I think RDS Aurora Postgres does let you have managed query plans

barrkel•3h ago
It's not really true. There are many session-scoped flags you can set which influence planner behavior, and sometimes toggling them for a specific query is what gets you through. More often, judicious use of CTEs as an optimization barrier (materialized CTE in moderrn versions) is useful to force execution order.

I like that Postgres has a lot of tools at its disposal for executing queries. But you can't rely on it for data even with modest scale. It's rare that it does a good job with interesting queries.

williamdclt•2h ago
I think we’re saying the same thing: you can’t force PG to a plan or an index, you can only change your query in hope it gets the hint.

Even session scoped flags are a really coarse tool, don’t guarantee you’ll get the plan you want and it might unexpectedly impact other queries in the session.

Materialised CTE are one of the only tools that give real control, but an optimisation barrier is often the opposite of what you want