|
|
|
|
|
by purerandomness
2923 days ago
|
|
SQL is a declarative language: You describe what you want, not how to get it. If that's not what you need, there are plenty of procedural languages whith which you describe how to get things. A query plan will change based on statistics. It's the engine's job to decide if your query is best served by parallelizing it to multiple cores, or deciding if it's worth JITing it before execution. The actual execution of the query is an implementation detail of the engine, and should be. That's the entire point of a SQL standard: To provide users with an interface to talk to engines, which then retrieve the data you asked for. It is its core strength and the reason why it's so successful. |
|
The entire archive of the pgsql users' mailing list disagrees. Every wants to know why their plan is suboptimal, or why it changed. People also want to know why the planner takes 100ms to generate the plan and only 1ms to execute the query, and so forth.
The idea that you just say what you want and you get the optimal result from your database is just ridiculous to anyone who has had to use them under any significant load.