V
V
Vlad Avtomat2019-11-22 15:37:07
SQL
Vlad Avtomat, 2019-11-22 15:37:07

Which database insert will be faster? Set values ​​to columns in insert or use default?

You need to insert tens of thousands of records per minute, so I want to know if there will be a difference in speed when inserting.
Why am I asking for default, since there is a large group of records for insertion, which by default will have the values ​​\u200b\u200bthey need.
The speed is needed as high as possible, that's why I'm interested.
Thanks for answers!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
d-stream, 2019-11-22
@VladSavelev

the third option: bulk insert will be much faster than the first two.
p / s / in general, conducting an experiment is faster than waiting for an answer on a toaster

F
FanatPHP, 2019-11-22
@FanatPHP

Lord, again we are optimizing non-existent problems.
Tens of thousands per minute is nothing at all.
On my working fart with a cheap HDD, 10 thousand are inserted in half a second . Normal prepared queries.
On a normal server with an SSD, there will be hundreds of thousands. per second. minutes are not mentioned at all.
Why are you all trying so hard to solve imaginary problems?
moreover, in the most stupid way - you suck out the most insignificant detail from your finger, which does not affect anything at all - and let's optimize it.
Well, wait for a real problem with performance, then analyze - what exactly is the reason, find the "bottleneck" - then optimize. Is it really such a complex algorithm?

L
Lazy @BojackHorseman, 2019-11-22
SQL

specify the values ​​explicitly

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question