logoalt Hacker News

sandeepkd • today at 6:43 AM • 2 replies • view on HN

The way the OP is trying to achieve all the goals by pushing the complexity on the queries/database is what I am referring to as non-scalable as data grows on SQL DB.

> If you have m distinct values in an index, then listing them this way takes m log(n) time, which is fine for many use cases no matter how much data you have.

And NO the runtimes are not right away applicable on machines at scale. You are dealing with DB locks, page sizes, available memory, existing data in memory, queue depth. Experienced folks get paid to short circuit such learnings


Replies

Dylan16807 • today at 7:13 AM

Selecting distinct values of a single column with a simple condition is hardly pushing complexity into the database.

adrianN • today at 7:02 AM

Runtimes are usually pretty well applicable at scale, it’s just that most people don’t have a good intuition about asymptomatic notation. Constants and lower order terms matter a lot in practice but are hidden in asymptotic notation.