Does the number of columns affect query performance?

前端 未结 6 681
春和景丽
春和景丽 2021-01-03 21:23

CASE 1: I have a table with 30 columns and I query using 4 columns in the where clause.

CASE 2: I have a table with 6 columns and I query using 4 columns in the whe

6条回答
  •  借酒劲吻你
    2021-01-03 21:41

    Depends on width of the table (Bytes per row), how many rows in the table, and whether there are indices on the columns used by the query. No definitive answer without that info. However, the more columns in the table, chances are it is wider. But the effect of a proper index is much more significant than the effect of the table size.

提交回复
热议问题