Knowledgebase

Working With Very Wide Tables Print

  • 0

Tables with many columns.

HOW THEY ARISE

Columns added over years, none removed.

WHAT PROBLEMS THEY CAUSE

Rows too large for efficient storage Reads pulling far more than needed Indexes that cannot cover queries Schema changes taking longer

WHAT TO LOOK FOR

Columns rarely populated Columns rarely read Groups of columns used only together

WHAT THAT LAST GROUP SUGGESTS

A separate table.

WHAT VERTICAL SPLITTING IS

Moving rarely used columns into a related table sharing the key.

WHAT IT PROVIDES

A narrow, frequently read main table.

WHAT IT COSTS

A join when the extra columns are needed.

WHEN THAT TRADE IS WORTH IT

When the main table is read constantly and the extras rarely.

WHAT TO BE CAREFUL WITH

Large text or binary columns stored inline.

WHY

They can be read even when not selected, depending on storage.

WHAT TO DO

Move them to a separate table, or out of the database.

WHAT TO MEASURE

Average row size, and how much is actually read.

WHAT TO AVOID

Splitting pre-emptively without evidence.

WHAT TO DO BEFORE ANY SPLIT

Confirm which queries would benefit, and by how much.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot