Is there a best practice for arranging database columns?

Are there any recommendations for arranging columns when designing a database? Will there be order execution performance, space or ORM level?

I know SQL Server - does column order matter? . I am looking for more general advice.

+3
source share
7 answers

I don’t think column ordering will necessarily affect performance and space. To improve performance, you can create indexes in a table, and the order of the columns defined in the index will affect performance.

, , , "" ( , ). , , "" .

+12

Oracle , NULLable, NULLable . NULL .

. : (id NOT NULL, name VARCHAR2(100), surname VARCHAR2(100), blah VARCHAR2(100, date_created DATE NOT NULL)

(100, NULL, NULL, NULL, '10-JAN-2000') 100, NULL, .

, , : (id NOT NULL, date_created DATE NOT NULL, name VARCHAR2(100), surname VARCHAR2(100), blah VARCHAR2(100))

(100, '10-JAN-2000', NULL, NULL, NULL) 100, - NULL .

, NULLable - , IO CPU, .

+4

. . , , , , .

, , , , .

+3

, .

RDBMS , , .

+3

(, ), , ,

(, ) where

where lastname like 'smith%'

+3

, , SQL.

-.

, .

, .

+1

, , (idfield, firstname, middlename, lastname, ). , , .

, , , .

+1

Source: https://habr.com/ru/post/1706830/


All Articles