Hi there,
We have some code that empties a table. Originally, the code used "delete
from", but I am told that this method was either too slow, or held a lock
for too long (this was a long time ago and I wasn't involved at that
point, so I'm not 100% sure exactly the nature of this problem). So the
code was changed to "truncate table". Now however, this table is being
replicated, so truncate table is no longer an option. I need to change the
code back to using delete rather than truncate. However, I want to avoid
the original problem. I was thinking of either two solutions; I can give a
row or page level locking hint, or I can delete groups of records at a
time, rather than all at once.
Basicially, I'd like to determine what behavior the query optimizer will
use for locking with a statement "delete from mytable" without any hints.
Then I will know whether specifying a hint will help, or whether it's
already using finer or coarser granularity and thus hints would be
useless. If possible, I'd rather be pointed towards a general purpose
solution, rather than the specific answer for this particular query so
that I can find out the next time myself... Also, a general rule of thumb
for the best way to efficiently clear out a table without excluding other
processes would be nice.
Thanks for any suggestions.
Dave
delete from 0 1501 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Brian Oster |
last post by:
After applying security patch MS03-031 (Sql server ver 8.00.818) a
query that used to execute in under 2 seconds, now takes over 8
Minutes to complete. Any ideas on what the heck might be going on?
I have tested this extensively and can say for certain that installing
this hot fix is what has caused the performance problem. I just don't
know why or how to fix it.
Brian Oster
|
by: Puvendran |
last post by:
Hi,
We have encountered deadlock on a table which is used to generate
sequential numbers for different categories eg typical entries
Category Value
TRADE_NO 1456
JOB_NO 267
.....
|
by: P Adhia |
last post by:
Hi,
I am trying to understand why following simple query is running very
slow (33 hours)
select ROW_ID
, a.CREATED
, a.CREATED_BY
, a.LAST_UPD
, a.LAST_UPD_BY
|
by: deepu03 |
last post by:
Hi All
I have the following query to be tuned..
SELECT distinct a.EMPLID
,a.PER_ORG
,a.HIRE_DT
,a.grade
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |