Hacker News new | ask | show | jobs
by daxvena 1094 days ago
I think you're missing what they're trying to say. You can still select what you actually need in a different order, but changing the order gives more immediate feedback from autocomplete. The order has pretty much zero impact on the performance of a query. A parser would still have to read out the whole query, and it's not expensive to unravel into a more efficient implementation if it would really help.

The problem is that SQL forces you to think about what to select before you even say where you're selecting from. There's nothing a client can do to recommend columns if it doesn't know where you're selecting from. It's pretty cumbersome to have to SELECT * FROM x and then go back and erase the * to actually get auto-completions.

It basically forces you to tell it what you want before you even know what the options are.

1 comments

You are missing what I said.

I know that from the interpreter's standpoint, it doesn't matter which one is written first.

What I meant is that as a human, if you have to think first of the columns you want to bring in, it will guide you towards the joins that you need and only those, rather than thinking "let me join all those tables because I need _some_ data from the entities inside".

My point about "autocompletion is still position" was not connected to the first part of my comment.

Even if I know the exact query I want to write, your suggestion does nothing to improve autocomplete for typing it in.
Yes because that's not the main point of my comment. Disregard completely the part about autocomplete if you want.

I just added it as a separate point, to say "you can have autocomplete no matter the order in which you write your query"...