Live data from Hacker News

Spending $5k to learn how database indexes work

briananglin.me

11–20 of 209 posts

Re: Spending $5k to learn how database indexes work

#11

Earlier quoted context omitted.

No that's still crazy. Scanning a million items isn't a big workload.

I agree, it might be distributed in some way which is driving up the cost?

The greed is distributed across the cloud provider's C-suite for sure. To be fair to them they refunded the bill afterwards according to the article but IMO we should not be accepting this kind of pricing models as normal.

A million items isn't a big deal, distributed or not. If anything, if your distributed architecture makes reading a million items more costly than a single machine doing it then it's time to go back to the drawing board.

Re: Spending $5k to learn how database indexes work

#12

Earlier quoted context omitted.

No that's still crazy. Scanning a million items isn't a big workload.

I agree, it might be distributed in some way which is driving up the cost?

They mention that PlanetScale uses Vitess, so indeed it might be distributed

Re: Spending $5k to learn how database indexes work

#13

I'm not a DB expert, but "750k users in a month." doesn't sound like a quantity that you'd need to use some kind of fancy special tooling for.

In a world where Juicero raised $120m, selling overengineered solutions for simple problems is not necessarily a bad idea.

Re: Spending $5k to learn how database indexes work

#14
I feel like indexes are a pretty fundamental type of DB knowledge. In fact I'd say it's table stakes knowledge you should have if you're working with them. Further more, knowing that ForeignKeys typically apply an index to that column is also in my head basic knowledge. I'm sorry you got burnt, and congrats on learning a lesson, but you could have gotten the same knowledge by ever googling MySql ForeignKeys and saved yourself a headache.

In fact it's like a big bullet point near the top of the docs page.

"MySQL requires indexes on foreign keys and referenced keys so that foreign key checks can be fast and not require a table scan. In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order. Such an index is created on the referencing table automatically if it does not exist. This index might be silently dropped later if you create another index that can be used to enforce the foreign key constraint. index_name, if given, is used as described previously."

I'm not entirely sure why buzz around "developer learns basic knowledge" has this on the front page.

Re: Spending $5k to learn how database indexes work

#16
This is definitely a lesson in the importance of indexes in general. We are well aware of the potential pitfalls with our current pricing. I’m happy to say we are nearly done modeling different metering rates for the product which would mean significantly lower bills for our users and avoid issues like this.

It’s core to our mission that our product’s pricing is accessible and friendly to small teams. Part of being in beta was us wanting to figure out the best pricing based on usage patterns. That work is nearly done. As the post mentions we’ve credited back the amount.

Re: Spending $5k to learn how database indexes work

#18
post #14

I feel like indexes are a pretty fundamental type of DB knowledge. In fact I'd say it's table stakes knowledge you should have if you're working with them. Further more, knowing that ForeignKeys typically apply an index to that column is also in my head basic knowledge. I'm sorry you got burnt, and congrats on learning a lesson, but you could have gotten the same knowledge by ever googling MySql ForeignKeys and saved…

> I'm not entirely sure why buzz around "developer learns basic knowledge" has this on the front page.

The problem is that in the old days, not knowing about indexes left you with an underperforming system or downtime. But in The Cloud™ it leaves you with an unreasonably huge bill and that somehow as an industry we're accepting this as normal.

Re: Spending $5k to learn how database indexes work

#19
post #13

I'm not a DB expert, but "750k users in a month." doesn't sound like a quantity that you'd need to use some kind of fancy special tooling for.

In a world where Juicero raised $120m, selling overengineered solutions for simple problems is not necessarily a bad idea.

The problem isn't selling (there's plenty of dubious or badly-priced products being around), it's that someone thought buying said product was a good idea.

Re: Spending $5k to learn how database indexes work

#20
post #14

I feel like indexes are a pretty fundamental type of DB knowledge. In fact I'd say it's table stakes knowledge you should have if you're working with them. Further more, knowing that ForeignKeys typically apply an index to that column is also in my head basic knowledge. I'm sorry you got burnt, and congrats on learning a lesson, but you could have gotten the same knowledge by ever googling MySql ForeignKeys and saved…

You'd be surprised and frustrated. If you ever see someone say "We hired Oracle consultants and they are miracle workers" or "NoSQL is sooo much faster than SQL" you can be pretty sure they missed databases 101 and the requirement to add indexes.
Post reply on HN