Home > Archive > MS SQL Server > December 2006 > Fastest way to delete to huge datarow?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Fastest way to delete to huge datarow?
Gerrit Horeis

2006-12-04, 7:12 pm

Hi all,
I've got a table which is storing Images with a size up to 1GB. When
I'm going to delete one of this rows the DELETE Statement takes up to 5

minutes. Which is the best way to delete the row more faster?

Has anyone an idea? Thanks in advance!


--
Gerrit Horeis


Software Developer
CI-Gate Development & Consulting GmbH
http://www.ci-gate.de
http://www.xira.de
http://www.bitbauer.de

Robert Klemme

2006-12-04, 7:12 pm

On 04.12.2006 15:29, Gerrit Horeis wrote:

> I've got a table which is storing Images with a size up to 1GB. When
> I'm going to delete one of this rows the DELETE Statement takes up to 5
>
> minutes. Which is the best way to delete the row more faster?
>
> Has anyone an idea? Thanks in advance!


Did you measure what is slow there? Do you have an index on that table?
Is it used for deletion? ... With the little information you disclose
it's hard to come up with any reasonable advice.

Regards

robert
Gerrit Horeis

2006-12-05, 7:12 pm

Hi

Thanks for your answer. In the table im storing several image formats.
The delete Statement is

"Delete from Formats where ID = @FormatID"

"ID" is the primary key of the table. Do I have to create an index as
well? I ever thought Sql just removes the reference to the data and so
it must be very fast.

Please help!



Robert Klemme schrieb:

> On 04.12.2006 15:29, Gerrit Horeis wrote:
>
>
> Did you measure what is slow there? Do you have an index on that table?
> Is it used for deletion? ... With the little information you disclose
> it's hard to come up with any reasonable advice.
>
> Regards
>
> robert


Robert Klemme

2006-12-05, 7:12 pm

On 05.12.2006 14:22, Gerrit Horeis wrote:
> Thanks for your answer. In the table im storing several image formats.
> The delete Statement is
>
> "Delete from Formats where ID = @FormatID"
>
> "ID" is the primary key of the table. Do I have to create an index as
> well? I ever thought Sql just removes the reference to the data and so
> it must be very fast.


It seems you got the basics right. But storage of BLOBS is usually more
complex and less efficient than, say, VARCHAR columns. I guess you have
to run the Profiler to find out why it is actually slow.

Kind regards

robert
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com