Re: Delete query taking long time to execute



Hi,

This is because of the multiple relationship. While deleting it checks all
the relationship. Where as if you execute a SELECT statement for the same
query
it will be faster. If you can do this during offline you could disable the
constraints [See ALTER TABLE WITH NOCHECK] to make the DELETE faster.
Since the number of records is very less it is not required to disable the
constratins


Thanks
Hari

"Somesh" <Somesh@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FD6E5B4A-34AF-4CF9-948D-6EA21944587C@xxxxxxxxxxxxxxxx
hi,
I have a table which is a Master to other 12 tables and it is Child for
other 2 tables.
Therefore, It has 14 relationships with other tables. The size of table is
very small. (approx 30-40 rows). It also has a clustered index in its
primary
key.

The problem I am facing here is that when I try to delete a row from the
table using its primary key in where clause, it takes more than 30 seconds
to
execute it. Any subsequent attempt will be of a shorter duration (approx
20-25 sec.) but still it is very time taking.

I can't understand what could be the problem here when the table size is
very small. Is it because of constraints or any other sort.

Please comment if you have any idea about it. Any help would be highly
appreciated.

Thanks!

Regards,
~Somesh



.



Relevant Pages

  • Re: Combining two row into one
    ... So you will have to remove the primary key from the SELECT ... iam trying to make a query which will return 1 row with n+n columns ... VB & then execute it.... ... Trust iam clear. ...
    (microsoft.public.access.queries)
  • How to get the primary key back after you done a single line insert?
    ... field MYPK which is an autogenerated primary key. ... Dim MyConn As New SqlClient.SqlConnection ... The execute scalar was supposed to return the first ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Jet.OLEDB and Access 2003
    ... It does have a primary key. ... As for the permission, it's ... > requires at least Read, Write, eXecute and Delete. ... >> I'm running an old ASP program that worked just fine w/ Access 2000 ...
    (microsoft.public.vb.database)
  • Re: Custom sort records in a stored proc
    ... based on parameter, you execute the respective ... create another table that holds information like tablename, ... > I have several stored procs that return two columns of data - primary ... > specific primary key value and have the corresponsding record appear ...
    (microsoft.public.sqlserver.programming)
  • class inheritance
    ... per class: approx. ... 20 methods have to Openand Close) has to execute the ... is the relationship between a base class and an inherited class the ... same as a parent-child class? ...
    (microsoft.public.dotnet.languages.csharp)