News for hackers. Stuff that matters.
Re:Show HN: PRQL 0.2 – a better SQL by hui-zheng on Monday June 27, 2022 @03:26PM (#31899543)
One benefit of SQL is that the Database Engine will do the hard work of optimizing the query plan.

Do you think the SQL complied by PRQL could be as effective and optimized by database engine as the direct-written SQL?

Re:Show HN: PRQL 0.2 – a better SQL by snthpy on Monday June 27, 2022 @04:04PM (#31900039)
As you said, let the Database Engine do the hard work of optimizing the query plan for you.

I currently have no reason to believe that the PRQL generated SQL would be any worse than hand written SQL. That said, I don't think we've currently looked at any ways of passing hints to the query planner. We're always open to suggestions!

In the worst case, you have full access to the generated SQL, and for absolutely crucial queries you can hand modify that SQL. At least PRQL might have saved you the trouble of writing a cumbersome window function or something like that (see for example the example of picking the top row by some GROUP BY expression).