Live data from Hacker News

Show HN: I wrote a free eBook about many lesser-known/secret database tricks

sqlfordevs.com

41–50 of 185 posts

Re: Show HN: I wrote a free eBook about many lesser-known/secret database tricks

#42
post #11

I have a very negative reaction to sites that require an email to get something of unknown value. Automatic no.

can someone share the pdf here for folks who don't wanna share their email?

To be honest. Just subscribe and the next time I wrote a free article and share it with you unsubscribe. I don‘t spam you. Ans I don‘t mind when you only want to grab the ebook.

Re: Show HN: I wrote a free eBook about many lesser-known/secret database tricks

#43
post #15
post #11

I have a very negative reaction to sites that require an email to get something of unknown value. Automatic no.

That's an interesting take, given that the landing page demonstrates its value with some example pages, and the index of topics. I can skim the chapter titles and get a pretty good idea of exactly what value there is. I'm not sure what's holding you up.

Your definition of value differs from that of others'.

Re: Show HN: I wrote a free eBook about many lesser-known/secret database tricks

#44
post #37

No, it's not weird to not want to give up an email address before knowing the value proposition, qup and icedchai.

I’m confused, I was able to see 10 pages each exposing a tricky SQL request with modern SQL features.

Maybe it’s been added in the face or HN grumpyness? ( tbh : I would not have give anything without those extracts, so your comments in on point )

Re: Show HN: I wrote a free eBook about many lesser-known/secret database tricks

#45
I haven't read the whole thing but I really enjoyed the introduction and agree completely. The RDBMS I've spent the most time with over the years is Microsoft SQL (immediately when 2000 was released) and over the years I've been surprised by two things: (a) How many developers that work with databases every day yet haven't the foggiest idea how to do anything the GUI tooling doesn't handle "easily" and (b) How quickly a developer can go from zero to "able to keep things performing well for all but the ugliest scenarios" knowledge-wise.

I've watched that last part unfold on many occasions. Usually I'd be brought in because the developers have done everything down to "copying the data to denormalized tables[0]" to try to sort out slowness. Most of the time, just "blindly investigating the schema" will turn up something frightening that the ORM did, or a mess of inappropriate indexes. Two indexes on a table used by nearly every query in the database caused 30 second requests to yield sub-second results in one case[1]. I'm never willing to walk in and promise that, but I can't think of a time it hasn't happened when similar circumstances were presented to me.

So if you're dragging your feet about learning SQL, take this as my encouragement: it's one of those things where the rewards come quick and the effort is far less than you probably expect.

[0] ... with a broken sync process that has to be run carefully b/c it hammers the already over-sized database every time it fires.

[1] If memory serves, it was an account table ... used a GUID between the app and the database, but primary key was an integer auto-incrementing field which was used as the FK to other tables. All I remember was adding a unique index to the GUID field and including the e-mail address/name columns which were included in every query. Ran the fix in production and it felt like "the dam broke".

Re: Show HN: I wrote a free eBook about many lesser-known/secret database tricks

#46
post #16

Nice tips. I'm interested in https://sqlfordevs.com/sorted-table-faster-range-scan Would you use this approach for something like: 1) movie_actors (movie_id, actor_id, order_index) 2) movie_watchlist (movie_id, user_id, created_at) 3) movie_ratings (movie_id, user_id, rating, created_at) I know strange question, but most guides suggest all these table should have autoincrement id column

These index choices are solid. But I suggest for the second one to swap the movie_id and user_id because in most cases you want to get all the watchlist entries for a user and not all users having the movie on the watchlist. Therefore all movies on a users watchlist are close to each other and not spread through the whole table by the movie_id.

Re: Show HN: I wrote a free eBook about many lesser-known/secret database tricks

#47

Has anyone been able to get the ebook? I submitted my email and confirmed the subscription, but no PDF sent I can only see the Tips section in the website.

I haven't either, but my best guess is that there's a bottleneck going on due to the site currently being on HN's frontpage

Re: Show HN: I wrote a free eBook about many lesser-known/secret database tricks

#49
post #2

In isolation because of Corona last year, I started to share many lesser-known database tricks I know on Twitter (@tobias_petry). Although I thought that only a few people would be interested in something like this, it became a matter of course over the months. Meanwhile, thousands follow me to read my database tips or news. Since every message in the constant social media stream vanishes after a few days, I had to d…

Gmail now started to classify the email with the ebook attachment as spam. After having worked without any problems before. I am now changing my code, give me a few minutes.

Fixed

Post reply on HN