Live data from Hacker News

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

sqlfordevs.com

131–140 of 185 posts

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

#131
post #72

Honest question- why does one choose to harvest emails for something like this vs just putting ads on the page? I have seen this model used for several ebooks, but it seems like long term its much more viable to just make the content widely available and put adwords on it or something similar.

You’re on the right track, the immediate value of the email addresses is near nil. Instead consider these email addresses are highly self-targeted due to the nature of the sign up. That can then be sold for direct use, for resale, or most likely for inclusion in larger data sets that aggregate tracking information about individuals for ad targeting and browsing/results personalization. For example, consider the value to Amazon to be able to match this expressed interest with the email address of my Prime account; they could then push SQL-related content on my Amazon front-page with justifiable confidence I’d buy something vs the default of showing me canned kidney beans. Of course, that they show me canned kidney beans _because_ I just bought an SSD does show how this is mostly pie in the sky/skynet nonsense.

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

#132
post #85

A person gives you a whole book they wrote for free and you're complaining about asking for an email? WTF

Agree. The guy provides engineering know how and we're pigeon dropping all over it for bureaucratic dorkish nonsense? You gotta have an attention span that separates noise from value

Vocal minority.

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

#134

I'm fairly adept at writing queries and have been using MySQL for what seems like an eternity. The multiple aggregates per query thing kinda blew my mind. I've certainly done that by using something like SUM(CASE WHEN x = y then 1 ELSE 0), but did not know you could just COUNT(x=y). Awesome.

Wow, I had no idea you could do multiple aggregates in a single query like that. I've always used the SUM(CASE...) method, but the COUNT(x=y) way is much cleaner and more efficient. Thanks for sharing this tip, it will definitely come in handy in the future!

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

#135
post #97
post #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 quickl…

Can you recommend some resources to achieve (b)? Just basic stuff without going full guru on every little detail. Or do you just mean using indexes basically? I'm just not sure how many unknown unknowns I have wrt sql.

(I am Not the OP) Not exactly from 0, maybe, but I strongly suggest this book: https://www.oreilly.com/library/view/the-art-of/0596008945/

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

#136
Nice effort on an interesting topic. However, the book could use a better technical review.

For example the first recipe will not work as expected with out a multi-column unique index (specifically the MySql example).

I feel that the preexisting knowledge required for such examples does not align with the stated target audience for the book.

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

#137
post #97
post #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 quickl…

Can you recommend some resources to achieve (b)? Just basic stuff without going full guru on every little detail. Or do you just mean using indexes basically? I'm just not sure how many unknown unknowns I have wrt sql.

The gist is:

1. Trace your application, so you know which query is running slowly in production.

2. Using this exact query, run `EXPLAIN ANALYZE` or whatever your RDBMS equivalent is.

3. Read the output, see which step is taking the slowest. Use google to help.

4. Google-fu until you find out which index might help you.

Over time, (3) and (4) requires less and less Google, because there's really only a few common cases that give you 100% of the speedup in 80% of cases.

Once you know this path to improvement exists, it's trivial to progress down it habitually. The `EXPLAIN ANALYZE` output looks like Greek at first, but quickly becomes as familiar to parse as a compiler error, etc.

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

#138
post #135
post #97

Earlier quoted context omitted.

Can you recommend some resources to achieve (b)? Just basic stuff without going full guru on every little detail. Or do you just mean using indexes basically? I'm just not sure how many unknown unknowns I have wrt sql.

(I am Not the OP) Not exactly from 0, maybe, but I strongly suggest this book: https://www.oreilly.com/library/view/the-art-of/0596008945/

If you're really starting out from square 1, I might read this book first: https://www.amazon.com/Database-Design-Mere-Mortals-Annivers... (although I read an earlier edition). The Art of SQL is a great book, but I wish I'd read something a bit...easier...first, lol. I struggled with it.
Post reply on HN