H
H
hrvasiliy2015-11-17 20:26:23
MySQL
hrvasiliy, 2015-11-17 20:26:23

How will the database run faster?

There is a table in a DB in which 15 columns. This table has 7 columns that will definitely be repeated. I think it's worth moving these 7 columns to a separate table + adding a column with a unique ID to both tables. The problem is that when writing to the second database, you first need to check 5 out of 7 columns for a match, and then add a new record, and in the first case we just add a new record + assign a unique ID + write the same ID to the first table.
As a result:
In the first case, we will have many repetitions, but there will be no extra requests to the database.
In the second case, there will be no repetitions, but there will be an order of magnitude more actions.
How will the database work more correctly and faster?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sim3x, 2015-11-17
@sim3x

How will the database work more correctly and faster?
use 3 nf
How will the database work more correctly and faster ?
denormalize
Denormalization should be carried out when you have already optimized all other bottlenecks

R
Ravshan Abdulaev, 2015-11-17
@ravshanium

habrahabr.ru/post/193756
it is hard to believe that performance issues can be higher than issues of logical data integrity, and that in this case they generally take place and cannot be solved by improving the query plan, for example, using indexes.

A
Andrew, 2015-11-17
@R0dger

It depends on what data .. if it is boolean, then you can make one field and use bit masks ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question