select * vs select column

前端 未结 12 996
后悔当初
后悔当初 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:12

    This immediately makes me think of a table I was using which contained a column of type blob; it usually contained a JPEG image, a few Mbs in size.

    Needless to say I didn't SELECT that column unless I really needed it. Having that data floating around - especially when I selected mulitple rows - was just a hassle.

    However, I will admit that I otherwise usually query for all the columns in a table.

提交回复
热议问题