Hi All,
I have table with 1574963 rows and grown up to 1.21 Tera Bytes. Table has a clustered idx and additional nonclustered idx is created.
App team is trying delete/archive some data in small chunks.
CREATE TABLE [dbo].[LogData](
[c1] [bigint] NOT NULL,
[c2] [int] NOT NULL,
[c3] [int] NOT NULL,
[c4] [ntext] NOT NULL, -->>
[c5] [int] NOT NULL,
[c6] [int] NOT NULL,
[c7] [int] NOT NULL,
[c8] [int] NOT NULL,
[c9] [int] NOT NULL,
[c10] [int] NOT NULL,
[c11] [nvarchar](255) NULL, -->>
[c12] [ntext] NULL, -->>
[c13] [int] NULL,
[c14] [bigint] NOT NULL,
[c16] [ntext] NULL, -->>
PRIMARY KEY CLUSTERED
(
[c1] ASC,
[c2] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
CREATE NONCLUSTERED INDEX [AeLogDataPidInsId] ON [dbo].[AeProcessLogData]
(
[c3] ASC,
[c1] ASC,
[c5] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
Questions)
1) App team managed has to delete 1 million records, but when we trying to shrink the data file, the space is not getting released to OS. Why? how to reclaim the space?
2) The deletes are VERY VERY SLOW ... Anyone explain why DELETE's are slow?
Thanks,
Sam
I have table with 1574963 rows and grown up to 1.21 Tera Bytes. Table has a clustered idx and additional nonclustered idx is created.
App team is trying delete/archive some data in small chunks.
CREATE TABLE [dbo].[LogData](
[c1] [bigint] NOT NULL,
[c2] [int] NOT NULL,
[c3] [int] NOT NULL,
[c4] [ntext] NOT NULL, -->>
[c5] [int] NOT NULL,
[c6] [int] NOT NULL,
[c7] [int] NOT NULL,
[c8] [int] NOT NULL,
[c9] [int] NOT NULL,
[c10] [int] NOT NULL,
[c11] [nvarchar](255) NULL, -->>
[c12] [ntext] NULL, -->>
[c13] [int] NULL,
[c14] [bigint] NOT NULL,
[c16] [ntext] NULL, -->>
PRIMARY KEY CLUSTERED
(
[c1] ASC,
[c2] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
CREATE NONCLUSTERED INDEX [AeLogDataPidInsId] ON [dbo].[AeProcessLogData]
(
[c3] ASC,
[c1] ASC,
[c5] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
Questions)
1) App team managed has to delete 1 million records, but when we trying to shrink the data file, the space is not getting released to OS. Why? how to reclaim the space?
2) The deletes are VERY VERY SLOW ... Anyone explain why DELETE's are slow?
Thanks,
Sam