Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
aidos
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
331.
▲
by
aidos
3y ago
Sure, but if you’re working in a sqlalchemy codebase, you should really learn enough sqlalchemy to get by. I don’t jump between languages and frameworks and expect a consistent experience but ideally I’d have an experience streamlined for t
332.
▲
by
aidos
3y ago
Low, maybe, but we’re out there. Sqla just saves me so much time in general. Sometimes it’s easier to drop down a level, but for 99% of my db interactions the code will be significantly shorter using sqla, so I choose to use it.
333.
▲
by
aidos
3y ago
To be fair, in sqlalchemy you could just do “print(query)” and you’d see your sql.
334.
▲
by
aidos
3y ago
I don’t think they ever did a lookup on phone number and even if you needed to, you would just index it and it’d be fast. You can even use things like tri-gram indexes to give you super fast partial phone number matching.
335.
▲
by
aidos
3y ago
Thanks for bothering to work it through, I was too lazy. But, yeah, exactly. Everyone thinks they need to optimise the life out of this stuff at the beginning but the db can do a lot with normalised data and the appropriate indexes. Side no
336.
▲
by
aidos
3y ago
Haha, sure, but the very first thing you should ask when faced with a slow query is to see the “explain analyse” output. Caching, in any form, is the last thing you want to reach for because it’s always more nuanced than you anticipate. To
337.
▲
by
aidos
3y ago
Everyone thinks they start their project with Facebook scale problems.
338.
▲
by
aidos
3y ago
Agreed. Matarialized views will be limited in use until we get nice incremental updating versions.
339.
▲
by
aidos
3y ago
I imagine so too. You’ll be able to interate over the users in order and hit an instant index on contact method. select * from user where exists ( select true from contact_
340.
▲
by
aidos
3y ago
That seems weirdly convoluted. So you store two columns to represent the foreign key?
341.
▲
by
aidos
3y ago
Interestingly, I often ask candidates about optimising a slow running db query and the majority of people jump to adding caching and very few ask if they can run an explain or see the indexes.
342.
▲
by
aidos
3y ago
They’ve been really good about promoting and supporting headscale. I feel like this comment from Bradfitz gives a nice little insight into the reality of open sourcing code. https://news.ycombinator.com/item?id=32470615
343.
▲
by
aidos
3y ago
Is…that it? There are apps that let you do that. If you were feeling sadistic you could write some AppleScript to do it for you.
344.
▲
by
aidos
3y ago
> CTEs aren't materialized so they're not tables. You might well know this, but one thing thats worth pointing out is that in Postgres you _can_ materialise the CTEs (though it's more to trick the planner when your use cas
345.
▲
by
aidos
3y ago
There’s nothing stopping people from using their own convention of selecting early to grab the stuff they need and selecting again right at the end to be explicit about what they want. Like select *, it’s better to just be explicit.
346.
▲
by
aidos
3y ago
Oh wow. The Amstrad 6128 was my first machine (1985). Looking forward to watching this!
347.
▲
by
aidos
3y ago
I agree with your further example cases (they were added after my comment). I was thinking more of the original post where someone was complaining about readability when you have joins and subqueries - which is the usecase for CTEs.
348.
▲
by
aidos
3y ago
Gotcha. The thing that’s not immediately clear from the syntax is which columns I’m getting out as a final result of my query. I guess the last select you ran + any derived ones since then?
349.
▲
by
aidos
3y ago
CTEs are basically temporary views and tables. I’d argue that the extra tables with duplicate data aren’t a space / cpu trade-off as much as they are a data management trade-off. There are cases for duplicating data in the system but I
350.
▲
by
aidos
3y ago
Is that true? Doesn’t this just effectively translate into sql to be executed on the db as usual if you’re running on an rdbms? Looking at the examples and the sql generated in the playground you’re just going to have the query planner doin
351.
▲
by
aidos
3y ago
Adding tables doesn’t sound like a solution at all and views come with operational overheads that you need to be aware of. CTEs should be the first thing you reach for when trying to clarify the intent of the way you’re chopping up your dat
352.
▲
by
aidos
3y ago
For what it’s worth, it looks really readable to me. I have decades of sql experience at this point so consider myself pretty proficient but I can see the appeal of having a terser syntax for transformations. I especially like the “it just
353.
▲
by
aidos
3y ago
Gotcha. That’s because of the 100% vs auto thing. These days everyone just puts “box-sizing: border-box” on everything to make it go away. This explains a bit more about what you’re seeing http://stackoverflow.com/questions&
354.
▲
by
aidos
3y ago
Is that a minizinc thing or a solver thing in general?
355.
▲
by
aidos
3y ago
I’ve played with minizinc in the past though we use scipopt now instead. The minizinc code looks pretty reasonable to me though. Specify your variables as ranges. Specify your constraints as math equations. Tell it what you’re looking to ma
356.
▲
by
aidos
3y ago
When I’ve run into this in the past Cloudflare Warp has been a bit of a saviour. It’s a hassle free way to flick a switch and follow a different path over the network.
357.
▲
by
aidos
3y ago
Any chance you could show an example? In theory a block level element can only sit inside another block level element. And those expand to the width of their parent unless you constrain the width.
358.
▲
by
aidos
3y ago
The parent has _some_ width, even if it’s not explicitly set.
359.
▲
by
aidos
3y ago
Fair, but actually that just means that the border and margin etc are pushed outside the container. In either case the div is operating by taking up the full width of the container.
360.
▲
by
aidos
3y ago
That’s kinda the point of flex though. The width is determined by the flex rules; width 100% doesn’t make much sense in that context.
More ›