如何加快SQL Server上的删除过程 [英] How to speed up the delete process on SQL server

查看:78
本文介绍了如何加快SQL Server上的删除过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have two tables, having parent-child relation. Each table contains around 14 lakh records. I want to delete data from the parent table along with the associated records in child table. The count of records to be deleted is around 4 lakh.
Directly firing a DELETE query in SQL freezes the database server. As the database is being used, I need a solution which will not cause the database to freeze. There are no indexes on both tables, but there are foreign keys in 4 other tables which reference a column of the child table (mentioned above).

Is there something which can speed up the delete process without freezing the database?





什么我试过了:



我尝试在父表上运行删除查询,级联删除子表中的记录,但这会冻结数据库服务器。目前我正在使用一个控制台应用程序(使用c#创建),它获取文件夹列表并逐个删除它们。



What I have tried:

I tried running a delete query on parent table which cascade delete the records from child table, but this freezes the database server. Currently i am using a console application(created using c#) which gets the list of folders and deleting them one by one.

推荐答案

你看过这个链接:执行快速SQL Server删除操作 - John Sansom [ ^ ]
have you seen this link: Performing fast SQL Server delete operations - John Sansom[^]


这篇关于如何加快SQL Server上的删除过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆