sql - First and Last name tables to increase performance? -



sql - First and Last name tables to increase performance? -

let's have client table:

customerid | firstname | lastname 1 | john | smith 2 | john | adams 3 | kevin | smith 4 | kevin | adams

now imagine table has 200k+ rows. increment performance create separate firstname , lastname table shown below , using joins view above?

example:

firstnameid | firstname 1 | john 2 | kevin lastnameid | lastname 1 | adam 2 | smith customerid | firstnameid | lastnameid 1 | 1 | 2 2 | 1 | 1 3 | 2 | 2 4 | 2 | 1

it depends on query workload. simple form of info compression. reducing set of info needed reply given query can improve performance.

on other hand introduce overhead in many places. trade-off. if want retrieve values of columns need join. dml becomes slower well.

since name columns rather little hard imagine query workload benefit scheme.

data_compression , backup compression can alternatives. create different trade-offs.

just prove there merit scheme: imagine long names , huge (tb-sized) table. space savings important because there rather few distinct names.

sql sql-server

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -