I have a table with few Columns like ID (PK), Name, created_time etc. and periodically I DELETE rows from this table by using this simple DELETE query.
DELETE FROM my_table WHERE created_time < 'some time';
Just want to know what will be the performance impact on INSERT
, SELECT
and DELETE
if I make or not make an INDEX
on created_time
.
This table may have millions of rows and one DELETE
query may delete rows in hundred thousands in one go.
Database : Oracle, JavaDB, DB2, SQL Server
If you make an INDEX on created_time. 1. Insert it will slow because it need to check column created_time is one time only(like a key). 2. SELECT and DELETE will quick if your condition where WHERE created_time = 'some time' It's mean if it find the first row of condition it will stop.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.