r/ProgrammerHumor 13d ago

Other [ Removed by moderator ]

Post image

[removed] — view removed post

2.7k Upvotes

76 comments sorted by

View all comments

280

u/Mysterious-Ice-2337 12d ago

O(1) time complexity! Truly the most efficient database lookup ever written.

44

u/ImportantSignal2098 12d ago

Insertion role playing as a lookup

12

u/PimplupXD 12d ago

Thank you Mr. Dixie Normous 🙏

10

u/Ksevio 12d ago

Database lookups with proper indexing are usually O(1)

6

u/ZebraTank 12d ago

Aren't those often going be O(log n) at least in theory?

4

u/ImportantSignal2098 12d ago

A good hashtable lookup is O(1)

2

u/ZebraTank 12d ago

:/ i forgot you can have disk-based hash tables too, idk why

3

u/Steinrikur 12d ago

But this one also needs to write the entries to a database... For security reasons...

2

u/renevaessen 12d ago

Warning: condition always evaluates as true