|
|
|
|
|
by craig_asp
2481 days ago
|
|
"Pull out the names of only the columns you need instead of using SELECT * to speed things up further." This is not performance-related in most cases. Unless the bottleneck is in the amount of data being transferred to a client over a network connection and there is a large amount of columns, or you have an index which matches the limited column list query exactly, there would be no performance difference in SELECT * vs SELECT <column list>. In columnar dbs it does matter because the less columns you select the less data gets accessed on disk. However, this does not hold true for row stores because data is stored in such a way that the whole row gets accessed no matter how many columns get specified in the query. There are many other good reasons why SELECT * is acceptable only in development queries, but performance is not one of them. |
|
This is especially important when querying views (or inline functions, if your DBMS supports them) built on top of several other layers of views.