|
tom对于limit值的观点
You Asked
Hi Tom, could you please tell me if exists any difference with LIMIT 1000 and for example LIMIT 100000? If I
increase the number of the limit... my process could run faster?
Thanks!
and we said...
it might
a) run faster (doubtful)
b) the same (doubtful)
c) slower
somewhere between 100 and 500 is typically "the best", getting 100k records INTO MEMORY and managing them take
"work"
What is the limit or the upper end of LIMIT.
At what threshold of LIMIT , will we get optimum performance.
i.e. what would you recommend the LIMIT to be , 1000 or 2000, or 3000 or 5000 or 10,000
Followup October 10, 2001 - 11am Central time zone:
I'd suggest hundreds, not thousands. There are ram concerns, you want to keep the interaction
between you and database going back and forth -- not "ok database do tons of work, then I'll do
tons of work and then I'll give you tons of work again". You want things to be flowing between you
and the database -- not "bursting" between you and the db.
Consider this -- if you array insert 10k rows - you might have to wait for LGWR to make room in the
redo buffer cache (sync writes to the file system). If you send him 100 or 500 rows -- you won't
wait and LGWR will flush the buffer cache in the background whilst you are off doing the next
100/500 rows.
"Consider this -- if you array insert 10k rows - you might have to wait for LGWR to make room in
the redo buffer cache (sync writes to the file system). If you send him 100 or 500 rows -- you
won't wait and LGWR will flush the buffer cache in the background whilst you are off doing the next
100/500 rows."
Firstly, YES, I will limit it to a figures between 100 and 500, but what can be the max number, out
of academic interest.
Secondly, what if the redo buffer has a lot of memory, then even in the case I set the limit at
5000, then it should not slow down the process, Iam I right.
Thirdly, Setting the LIMIT to a lesser number, does it also mean faster execution. , then when you
set the LIMIT to a hight number.
KIndly expand on the below--
"if you array insert 10k rows - you might have to wait for LGWR to make room in the redo buffer
cache (sync writes to the file system). "
|
|