News for hackers. Stuff that matters.
Re:Why SELECT * is bad for SQL performance (2020) by dathinab on Monday February 15, 2021 @05:20PM (#26148295)
> [...] > was superior to this: > [...]

For API Stability:

- querying only the columns you really need makes it less likely that a column you don't really need happens to somehow brake your code if changed (e.g. because some ORM mapping not working). (This btw. is one of the major drawbacks of many REST APIs, i.e. they default to the rest equivalent of ).

- deciding the order in which you want columns to be returned explicitly is less bug prone to a variety of bugs, relying on column order of `` is brittle but some ORM do so and some other code might do so by accident in some way or another. Explicitly defining the order makes it easier to avoid such bugs.

- SQL queries doesn't need to be updated if you add columns (to explicitly not query the for the query unnecessary new column)

There are no comments on this comment yet.