Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 4 of 4 total |
Delete query running out of memory |
Wed, Apr 8 2009 6:13 AM | Permanent Link |
Ian Turner | Hi there.
I have a a query that I use to delete certain records from a database when the program is closed down, which is now suddenly giving an 'Out of Memory' error after a number of trouble free years use. It is running in local mode on a stand-alone computer with 256MB of memory and plenty of hard disk space. The table is nothing special, record size is 144 bytes, although it does have a blob field (Blob Size 512) that stores an Async Pro fax image. It uses the following SQL statement ... DELETE FROM mnfax WHERE (status = 'S') and ((type = 'MAIL') or (type = 'ENQY')) There are currently around 104,000 records on the table and the query would delete about 800 records. Does anyone know if the amount of memory required by a SQL DELETE statement increases as the number of records deleted increases? Do I need to write a delete loop in Delphi to replace the query or is there some way to get the query to work in this limited amount of memory? Many thanks, Ian Turner DBISAM 4.25 build 3 Delphi v7 Windows XP |
Wed, Apr 8 2009 10:21 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Ian
I've certainly used SQL to delete more records than that in one go. My first guess would be its something weird in one of the blob fields. My approach for many years, since I used full text indexing a lot and it made it faster, was to have a small script the first part of which set the blob fields to ''. Might be worth a try. Roy Lambert [Team Elevate] |
Mon, Apr 13 2009 6:46 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ian,
<< I have a a query that I use to delete certain records from a database when the program is closed down, which is now suddenly giving an 'Out of Memory' error after a number of trouble free years use. It is running in local mode on a stand-alone computer with 256MB of memory and plenty of hard disk space. The table is nothing special, record size is 144 bytes, although it does have a blob field (Blob Size 512) that stores an Async Pro fax image. It uses the following SQL statement ... DELETE FROM mnfax WHERE (status = 'S') and ((type = 'MAIL') or (type = 'ENQY')) There are currently around 104,000 records on the table and the query would delete about 800 records. >> I would check those 800 records and make sure that there isn't a huge BLOB in there that you're not aware of. After that, I would go ahead and repair the table to make sure that it isn't a situation where the BLOB blocks are corrupted. Also, for fax images I would suggest a higher BLOB block size than 512 bytes. I've posted a little application in the Binaries newsgroup that gives a recommendation for an ideal block size for a givent table. It was originally written by me, but Chuck Todd was kind enough to make it really cool with a histogram. -- Tim Young Elevate Software www.elevatesoft.com |
Fri, Apr 17 2009 7:00 AM | Permanent Link |
Ian Turner | Thank you Roy and Tim for your kind help.
I have now visited the customer's site and the problem was purely a lack of system memory. Using Commit Interval 30 in the SQL Delete statement solved the problem. The reason why it flared up at this point was totally my fault (as is usually the case). I had recently allowed another program to use the fax database to send mailshot faxes and whilst the original design only had fax sizes of 20-30K, the mailshot was generating fax data in the region of 500-800K!! Old age creeping up on me I think. I should add a further thanks to Tim and Chuck. The BlobSize app was really useful in looking at the spread of sizes. Many thanks, Ian |
This web page was last updated on Tuesday, May 7, 2024 at 06:25 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |