开发者

have truncate and drop index better performance than drop table, create tale and create index?

开发者 https://www.devze.com 2022-12-17 21:04 出处:网络
I have a simple question: Scenario: Whose Perfomance is better ? 1) DROP INDEX --> TRUNCATE TABLE -->

I have a simple question:

Scenario:

Whose Perfomance is better ?

1)

DROP INDEX -->
TRUNCATE TABLE --> 
AND THEN FILLUP DATA -->
AND THEN CREATE INDEX

2)

DROP TABLE -->
CREATE TABLE -->
FILLUP DATA-->
CREATE INDEX

I am using a t开发者_StackOverflowable with millinos of recods. Which of these queries would suit my needs best?


Between the two methods, populating the data and then creating the index will be 99% of the time it takes to do the operation, I wouldn't worry that much if truncate or drop is faster after all both are not fully logged operations


The only real answer here is to try it and see - I expect that there will be very little difference in performance.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号