select * vs select column

前端 未结 12 830
后悔当初
后悔当初 2020-11-22 05:42

If I just need 2/3 columns and I query SELECT * instead of providing those columns in select query, is there any performance degradation regarding more/less I/O

12条回答
  •  别跟我提以往
    2020-11-22 06:05

    You should always only select the columns that you actually need. It is never less efficient to select less instead of more, and you also run into fewer unexpected side effects - like accessing your result columns on client side by index, then having those indexes become incorrect by adding a new column to the table.

    [edit]: Meant accessing. Stupid brain still waking up.

提交回复
热议问题