How can I improve large deletes?

Hi,
In order to keep our database size to an acceptable level, we delete all records older than 4 hours, every 15 minutes with a delete statement like this:
DELETE FROM mytable WHERE add_time < (1174391100000 - 14400000);
add_time is a BIGINT containting the number of milliseconds when the record was added to "mytable". 1174391100000 is the current time in ms and 14400000 is 4 hours in ms.
This delete removes on average 200000 records from a database with some 2 million records. The delete takes about 30 seconds. The documentation states that it is wise to avoid large deletes. Howvever I can't use TRUNCATE, since most of the data is still in use. The number of records to delete vary, so I don't know how many times a DELETE FIRST 10000 would be needed.
Is there any other way to speed up the delete process in TimesTen?
(e.g. in Oracle you would use a PL/SQL procedure, loop through a cursor and commit every 10000 records).

bwas.as_user schema =
CREATE TABLE bwas.as_user (
user_uid INTEGER not null,
cust_group_uid INTEGER not null,
user_id VARCHAR(161) NOT INLINE NOT NULL,
first_name VARCHAR(30) not null,
last_name VARCHAR(30) not null,
first_name_unicode NVARCHAR(30) not null,
last_name_unicode NVARCHAR(30)not null,
title NVARCHAR(50) NOT INLINE,
email VARCHAR(80) NOT INLINE,
mobile_odn CHAR(30),
pager_odn CHAR(30),
name_rec_flag CHAR(1) not null,
name_rec_filename NVARCHAR(256) NOT INLINE,
time_zone_id VARCHAR(80) NOT INLINE,
auth_failed_flag CHAR(1) not null,
voice_portal_pswd CHAR(30),
user_type CHAR(10) not null,
primary_as_uid INTEGER not null,
active_as_uid INTEGER not null,
dept_uid INTEGER,
hiragana_first_name NVARCHAR(30),
hiragana_last_name NVARCHAR(30),
vp_pswd_not_set_flag CHAR(1),
clid_num CHAR(16),
language_uid INTEGER not null,
yahoo_id VARCHAR(50) NOT INLINE,
failed_vp_attempt TINYINT,
last_passcode_modified BIGINT,
vp_fail_notification_sent CHAR(1),
search_last_name_unicode NVARCHAR(30) not null,
search_first_name_unicode NVARCHAR(30) not null,
vp_auto_login CHAR(1) not null,
PRIMARY KEY (user_uid),
FOREIGN KEY (cust_group_uid) REFERENCES bwas.cust_group (cust_group_uid),
FOREIGN KEY (primary_as_uid) REFERENCES bw.peering_hosts (host_uid),
FOREIGN KEY (active_as_uid) REFERENCES bw.peering_hosts (host_uid),
FOREIGN KEY (dept_uid) REFERENCES bwas.dept (dept_uid),
FOREIGN KEY (language_uid) REFERENCES bwas.language (language_uid))
UNIQUE HASH ON (user_uid) PAGES = 10;
There are 10098 rows in bwas.as_user
bwas.cust_group schema =
CREATE TABLE bwas.cust_group (
cust_group_uid INTEGER not null,
cust_group_id VARCHAR(30) not null,
name VARCHAR(80) NOT INLINE,
name_unicode NVARCHAR(80) NOT INLINE,
svc_provider_uid INTEGER not null,
pswd_rule_uid INTEGER not null,
time_zone_id VARCHAR(80) NOT INLINE NOT NULL,
extension_len TINYINT not null,
clid_num CHAR(16),
use_clid_num_flag CHAR(1) not null,
use_desc_clid_flag CHAR(1) not null,
user_limit INTEGER not null,
loc_code CHAR(15),
search_name_unicode NVARCHAR(80) NOT INLINE,
PRIMARY KEY (cust_group_uid),
FOREIGN KEY (svc_provider_uid) REFERENCES bwas.svc_provider (svc_provider_uid),
FOREIGN KEY (pswd_rule_uid) REFERENCES bwas.pswd_rule (pswd_rule_uid))
UNIQUE HASH ON (cust_group_uid) PAGES = 10;
Number of rows = 53
bwas.svc_provider schema =
CREATE TABLE bwas.svc_provider (
svc_provider_uid INTEGER not null,
svc_provider_id VARCHAR(30) not null,
name NVARCHAR(80) NOT INLINE,
pswd_rule_uid INTEGER not null,
support_email VARCHAR(80) NOT INLINE,
enterprise_flag CHAR(1) NOT NULL,
use_custom_routing_prof_flag CHAR(1) NOT NULL,
PRIMARY KEY (svc_provider_uid),
FOREIGN KEY (pswd_rule_uid) REFERENCES bwas.pswd_rule(pswd_rule_uid))
UNIQUE HASH ON (svc_provider_uid) PAGES = 10;
Number of rows = 4
The delete statement I posted initially wasn't quite correct, here is the correct one:
DELETE FIRST 1000
FROM bwas.user_assn_ftr_svc
WHERE user_uid
IN (SELECT user_uid
FROM bwas.as_user,
bwas.cust_group,
bwas.svc_provider
WHERE as_user.cust_group_uid = cust_group.cust_group_uid
AND cust_group.svc_provider_uid = svc_provider.svc_provider_uid
AND svc_provider.svc_provider_id = ? );
The query plan for the select is:
Query Optimizer Plan:
STEP: 1
LEVEL: 3
OPERATION: RowLkTtreeScan
TBLNAME: BWAS.SVC_PROVIDER
IXNAME: IDXUSVC_PROVIDER01
PRED: SVC_PROVIDER.SVC_PROVIDER_ID = 'MarioSP50'
OTHERPRED: <NULL>
STEP: 2
LEVEL: 3
OPERATION: RowLkTtreeScan
TBLNAME: BWAS.CUST_GROUP
IXNAME: TTFOREIGN_11
PRED: CUST_GROUP.SVC_PROVIDER_UID = SVC_PROVIDER.SVC_PROVIDER_UID
OTHERPRED: <NULL>
STEP: 3
LEVEL: 2
OPERATION: NestedLoop
TBLNAME: <NULL>
IXNAME: <NULL>
PRED: <NULL>
OTHERPRED: <NULL>
STEP: 4
LEVEL: 2
OPERATION: RowLkTtreeScan
TBLNAME: BWAS.AS_USER
IXNAME: TTFOREIGN_34
PRED: AS_USER.CUST_GROUP_UID = CUST_GROUP.CUST_GROUP_UID
OTHERPRED: <NULL>
STEP: 5
LEVEL: 1
OPERATION: NestedLoop
TBLNAME: <NULL>
IXNAME: <NULL>
PRED: <NULL>
OTHERPRED: <NULL>
Here are the ODBC settings we use on the Solaris system:
Driver=/usr/local/TimesTen/tt_base/lib/libtten.so
Authenticate=0
AutoCreate=0
DurableCommits=0
ExclAccess=0
Isolation=1
LockLevel=0
Logging=1
LogBuffSize=8192
LogFileSize=8
LogPurge=1
MatchLogOpts=0
MemoryLock=0
OverWrite=0
PermSize=512
Preallocate=0
Temporary=0
TempSize=170
ThreadSafe=1
WaitForConnect=0

Similar Messages

  • HT5731 how can I cancel or delete a movie i downloaded to my iPhone?  The file is too large and it is hung up during the download process

    How can I cancel or delete a movie I tried to download to my iPhone?  The file is too large and iTunes is hung up during the process of downloading.  I've tried to swipe from right to left but that doesn't produce a delete button....

    Slide your finger across the videos' listing in your iPhone Videos App and tap the red "Delete" button that appears.

  • How can I most quickly delete a large number of outlook messages from my iphone?

    How can I most quickly delete a large number of outlook messages from my iphone?

    Who is the email account provider?
    If the email account is an exchange or IMAP account that you access with Outlook on your computer, delete the email with Outlook which will remove the email from your iPhone.

  • How can I improve the stability of itunes64bit 8.0.2 on my Vista system?

    Vista Home Premium: iTunes64bit: application crashes after adding album photos and then changing views (list, Album, split) or clicking on different playlists and back to the entire music library.
    The library has 42,000 items (mostly music) so it is quite large. At launch it takes a long time for itunes to load and display. There is no user cues telling me it is running. It simply displays after 60 or more seconds.
    Then I start working in the library, pasting pictures to multiple items, modifying album titles.
    After doing a few management tasks on my music items and navigating back and forth between the music library and playlist (changing views), the application stop being responsive and according to the log, the app just plainly crashes.
    Sometimes I can restart successfully but most of the times, I need to stop the itunes service or log-out before I can restart it successfully.
    I am using itunes64bit 8.0.2
    I am running it on a machine equipped with 4GB of ram and the library lives on a 500GB external hard drive plugged-in through USB 2.0.
    How can I improve the stability of itunes64bit on my system?
    Message was edited by: JF Boisvert

    This VI can be convert to labview 8.0 because subvi are not compatible with old version.
    I post a screenshot.
    Aurélien J.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Du 30 juin au 25 août, embarquez pour 2 mois de vidéo-t'chat ! Prenez place pour un voyage au coe...
    Attachments:
    image.jpg ‏38 KB

  • TS1702 how can I remove large number of photos on my iPhone 4s from iTunes using a PC - Lenovo Think Pad - so that I can reduce the space used on the phone by 50%?

    how can I remove large number of photos on my iPhone 4s from iTunes using a PC - Lenovo Think Pad - so that I can reduce the space used on the phone by 50%?

    You don't need iTunes for that. Simply connect the iPhone to the PC where it will be recognized as a camera. You can then select the photos you wish to transfer, transfer them, and delete them.

  • How can I flip my iphone videos on my PC? My videos from my iphone are horrible when I transfer them to my PC. How can I improve the video on my PC? Can I just convert the files to WMV? When the video plays the speed is off, it's half slow-motion

    My videos from my iphone are horrible when I transfer them to my PC. How can I improve the video on my PC? Can I just convert the files to WMV? When the video plays the speed is off, it's half slow-motion and staggers into normal play. The clips are slightly cut as well, the clips do not roll continuously.  I'm taling about videos that are no more than 2 minutes long.  I'm frustrated and I could really use some advice-my kids basketball games is what I'm recording and I'm trying to send them to my family (they are not very tech savvy). Thanks

    Not it's only function but one for which it was most admirably suited, which is why I really hope someone can find a work around. I am hoping my post to the Apple feedback may prompt a useful response from Apple and I live in hope that my post here will elicit a useful response from another user. I did not miss the the text at the top of the feedback form but you presumably missed my initial text, 'someone here can explain' or my subsequent 'work around from another user'
    Just in case anyone reading this has a large collection of music videos, video podcasts or iTunes U then DO NOT upgrade your iPad to iOS 5. If you are considering purchasing the iPad as a useful mobile device to experience these media organised in your iTunes please don't as you will be wasting your money. (unless someone on this forum knows of a way to undo the mess created by those infallible folks at Apple)
    Yes I know it does other things but the purpose I bought it for doesn't work anymore

  • How Can we improve the report performance..?

    Hi exports,
    I am learning the Business Objects XIR2, Please let me know How Can we improve the report performance..?
    Please give the answer in detailed way.

    First find out why your report is performing slowly. Then fix it.
    That sounds silly, but there's really no single-path process for improving report performance. You might find issues with the report. With the network. With the universe. With the database. With the database design. With the query definition. With report variables. With the ETL. Once you figure out where the problem is, then you start fixing it. Fixing one problem may very well reveal another. I spent two years working on a project where we touched every single aspect of reporting (from data collection through ETL and all the way to report delivery) at some point or another.
    I feel like your question is a bit broad (meaning too generic) to address as you have phrased it. Even some of the suggestions already given...
    Array fetch size - this determines the number of rows fetched at a single pass. You really don't need to modify this unless your network is giving issues. I have seen folks suggest setting this to one (which results in a lot of network requests) or 500 (which results in fewer requests but they're much MUCH larger). Does either improve performance? They might, or they might make it worse. Without understanding how your network traffic is managed it's hard to say.
    Shortcut joins? Sure, they can help, as long as they are appropriate. [Many times they are not.|http://www.dagira.com/2010/05/27/everything-about-shortcut-joins/]
    And I could go on and on. The bottom line is that performance tuning doesn't typically fall into a "cookie cutter" approach. It would be better to have a specific question.

  • Hello there,  there is a rare window that keeps popping up every time i start Logic.  I'd like to send a screenshot... anyway, it's a "tempo" window with strange layout about midi effects and so,.... is it normal?  How can i improve this?  Thanks.

    hello there,  there is a rare window that keeps popping up every time i start Logic.  It's a "tempo" window with strange layout about midi effects and so,.... is it normal?  How can i improve this?  Thanks.

    Hmm, that's some sort of MIDI Arpeggiator setup in your environment. Strange that you don't know it, this has to be custom-installed, it is not part of the standard setup.
    You can do two things about it:
    1.unlock your current screenset (shift-L), then close the (Bass Driver) window, then relock the screenset (shift-L). Next time you open up this project you won't see the Bass Driver, but it is still in the project.
    2. You can remove the whole page: open the Environment (cmd-8), then go to the dropdown menu arrow top left of the Environment window and select the Bass Driver layer. If it is selected, dropdown again and choose Delete. Now Save your project under a different name (Save As...), so that you still keep the Bass Driver setup in the original project. If you don't need to keep it, you can simply Save.

  • How can I recover a delete accidently genre from my playlist? It's all gone even the genre title

    How can I recover a delete accidently genre from my playlist? It's all gone even the genre title

    As long as you don't delete the trash, the files should be recoverable.
    I suspect using the Put Back command could take a long time, so be patient.
    If your Time Machine backups are mixed with your daughter's backups you might want to buy a larger drive and move the Time Machine files to the new drive.
    Regarding missing photos in iPhoto...There might be options to rebuild/recover that data from iPhoto rather than trying to revert to a Time Machine backup.
    Check out this third party app, iPhoto Library Manager. It has a demo.
    http://www.fatcatsoftware.com/iplm/
    Options for a larger drive.
    I like the Seagate USB 3.0 Backup plus drives. Works on USB 2.0 ports. They come formatted for PC but easy to format in Disk Utility.
    I don't recommend Western Digital because of the boot problem with some of their drives.
    LaCie makes good drives.
    All Mac formatted drives will cost more and it’s easy to reformat with Disk Utility. Do not use the software that comes with the drives. It’s recommended that you use Apple’s Disk Utility.
    Prices vary but this gives you an idea of what you’ll find. As you notice the second and third TB is usually only $15 more per TB. Normally, you’ll find these prices but right now the 1T is more than the 2T
    Seagate Backup Plus 1 TB USB 3.0 $85
    Seagate Backup Plus 2 TB USB 3.0 $99
    Seagate Backup Plus 3 TB USB 3.0 $115
    I have seen the 3T on sale for $99.
    Locally, Best Buy seems to have the best prices.

  • How can i improve the speed of my mac?

    my mac has 667 MHz, how can i improve the speed?

    Sorry if that sounded not very helpful, but basically it comes down to that. Not much can improve the performance of machine of that vintage, to stand up to a current model, unless you spend almost as much on upgrades (some of which to consider are listed below).
    Some thought should be given to the budget (money and time and effort) one is willing to spend. The G4 Digital Audio is possibly a good candidate for upgrading for someone who is interested in do-it-yourself computer stuff and bargain hunting for parts. It can even be a fun hobby. But even max-ing out all possible upgrades will still be lacking in performance compared to the current Mac models, I don't actually have any specific benchmarks, just my gut feel. And you may spend a good portion of the cost of a new machine on all those parts for the old machine.
    Is this the 667MHz machine (G4 Digital Audio) in question?
    http://www.lowendmac.com/ppc/digital-audio-power-mac-g4.html
    http://eshop.macsales.com/Descriptions/specs/Framework.cfm?page=g4da.html&title= Power%20Macintosh%20G4%20Digital%20Audio
    or is it some other model?
    Here are some CPU upgrades, for example:
    http://eshop.macsales.com/MyOWC/Upgrades.cfm?sort=pop&model=162&type=Processor&T I=2420&shoupgrds=Show+Upgrades
    you can even get a small rebate for your original CPU
    http://eshop.macsales.com/Service/rebate-program/
    Any of those CPUs should double your processing speed, but you may also need more RAM...or the CPU will just be waiting for data to be read from the virtual memory on the hard drive.
    http://eshop.macsales.com/item/Other%20World%20Computing/133SD512328/
    you could max it out with a whopping 1.5 GB, with 3 of these.
    and you may need a better video card...
    http://eshop.macsales.com/MyOWC/Upgrades.cfm?sort=pop&model=162&type=Video&TI=29 34&shoupgrds=Show+Upgrades
    To add larger and faster hard drives than the original Ultra ATA/66 can handle you would need a PCI ATA133 or PCI SATA card...
    http://eshop.macsales.com/item/ACARD/AEC6280MOB/
    http://eshop.macsales.com/item/Sonnet%20Technology/TSATA/
    And if you need to install OS X from a DVD, and want to burn your own DVD, you may need a new optical drive, if one hasn't been installed already, to replace the CD-RW:
    http://eshop.macsales.com/MyOWC/Upgrades.cfm?Model=162&Type=InternalOpticalDrives&sort=pop
    Also, check out the Power Macintosh G4 forums if you have any questions about that particular model, (if I guessed correctly)
    http://discussions.apple.com/category.jspa?categoryID=113
    Even while I am trying to build a case to convince someone not to waste their money on this project, I am thinking to myself, where can I pick up one of these G4 towers to take on this project myself. Maybe a Quicksilver, no a FW400 MDD dual-boot for sure, I still have some OS 9 software. I did about all I can with my G3 Desktop, and spent more than my MacBook cost.

  • How can I remove or delete my posts and resign my membership with Adobe?

    How can I remove or delete my posts and resign my membership with Adobe?

    At the bottom see terms of use you own your content and can ask for its removal but it may remain in the sites backup.  The problem is your responsible to remove it and the way the site code works once an append is made to your's.  Your content becomes locked and you can no longer delete it. IMO part (c) is broken....
    3. Your Content.
    3.1 Ownership. You retain all rights and ownership of your content. We do not claim any ownership rights to your content.
    3.2 Licenses to Your Content in Order to Operate the Services. We require certain licenses from you to your content to operate and enable the Services. When you upload content to the Services, you grant us a non-exclusive, worldwide, royalty-free, sub-licensable, and transferrable license to use, reproduce, publicly display, distribute, modify (so as to better showcase your content, for example), publicly perform, and translate the content as needed in response to user driven actions (such as when you choose to store privately or share your content with others). This license is only for the purpose of operating and improving the Services.
    3.3 Our Access. We will not access, view, or listen to any of your content, except as reasonably necessary to perform the Services. Actions reasonably necessary to perform the Services may include (but are not limited to) (a) responding to support requests; (b) detecting, preventing, or otherwise addressing fraud, security, unlawful, or technical issues; and (c) enforcing these terms.
    3.4 Sharing Your Content.
    (a) Sharing. Some Services may provide features that allow you to Share your content with other users or to make it public. “Share” means to email, post, transmit, upload, or otherwise make available (whether to us or other users) through your use of the Services. Other users may use, copy, modify, or re-share your content in many ways. Please consider carefully what you choose to Share or make public as you are entirely responsible for the content that you Share.
    (b) Level of Access. We do not monitor or control what others do with your content. You are responsible for determining the limitations that are placed on your content and for applying the appropriate level of access to your content. If you do not choose the access level to apply to your content, the system may default to its most permissive setting. It’s your responsibility to let other users know how your content may be shared and adjust the setting related to accessing or sharing of your content.
    (c) Comments. The Services may allow you to comment on content. Comments are not anonymous, and may be viewed by other users. Your comments may be deleted by you, other users, or us.
    3.5 Termination of License. You may revoke this license to your content and terminate our rights at any time by removing your content from the Service. However, some copies of your content may be retained as part of our routine backups.
    3.6 Feedback. You have no obligation to provide us with ideas, suggestions, or proposals (“Feedback”). However, if you submit Feedback to us, then you grant us a non-exclusive, worldwide, royalty-free license that is sub-licensable and transferrable, to use, reproduce, publicly display, distribute, modify, and publicly perform the Feedback.
    3.7 Account Information.
    You are responsible for all activity that occurs via your account. Please notify Customer Support immediately if you become aware of any unauthorized use of your account. You may not (a) Share your account information (except with an authorized account administrator) or (b) use another person’s account. Your account administrator may use your account information to manage your use and access to the Services.

  • Hello, How can I edit or delete a custom label in the contacts list on iOS 7.0.3 on iPhone 4S ?

    Hello, How can I edit or delete a custom label in the contacts list on iOS 7.0.3 on iPhone 4S ?
    i need it so muchhh!

    Sort of depend on what you are trying to do precisely. In Edit mode, if you tap on any label, you will be given a list of options, plus an Add Custom Label option near the bottom of the list

  • How can I edit or delete a custom label in the contacts list on iOS 7 on iPhone 4S ?

    How can I edit or delete a custom label in the contacts list on iOS 7 on iPhone 4S ?

    Alfre311 wrote:
    I've been trying to find a way to do this since I updated to IOS 7, and I've just found the solution/explanation, even tho is a bit heavy to carry out.
    IOS 6 creates custom labels and save them giving you the option to delete them.
    IOS 7 creates custom labels but don't save them, so there is no need to have the option to delete them.
    But here comes the problem, if you have some custom labes saved in you Iphone / Ipad with IOS 6 and you update it to IOS 7, the device will keep those labels saved, but you wont be able to delete them.
    I realized this by going to contacts on Icloud. There those labels that I had on my devices weren't there. So simply restoring your device and configuring it as a new one to later sync your Icloud Contacts, will solve the problem.
    I know this post is old, but I might just try this with iOS 8. I have outdated custom labels that annoy me, because I still seem them in the list as options. If I get desperate enough, I may try your solution.

  • How can I see my deleted messages on my icloud

    How can I see my deleted message and message from my icloud

    Huh? You can't. Once you delete something, well it's deleted.
    If you have a backup, that contains these deleted messages, you can restore from that backup, to restore them to your phone. If no backup, or your backup has been overwritten, then they are gone.

  • How can I improve quality of image when burning a movie to a DVD

    How can I improve quality of image when burning a movie to a DVD?

    What resolution are you using?  If the DVD is to be playable on an ordinary DVD player, only ordinary TV resolution is supported.  You need Blue ray for HD.
    Geoff.

Maybe you are looking for

  • How to convert Xstring to PDF format and send pdf to multiple user

    Hi to all can any one provide me saple code to convert Xstring to PDF format and send pdf to multiple user i have searched the SDN , but cant get any proper soulution. I shall be thankful to you for this. Regards Pavneet Rana

  • 80gb classic, dumps music on software update

    Very frustrating, spent ages up loading music into new ipod 80gb, through itunes the ipod self updated its software. Now it has lost all the music about 8gb, but has kept all the photos and contacts. For the music it is set to manual update from itun

  • Illustrator File Previews are gone Since updating to CC 2014

    I know that this has been a problem with previous versions of Illustrator as well, but I am still unsure if there is any fix that I can do on my end or not. I use to be able to preview all of my .ai files with Windows Explorer in Windows 7 Pro 64-bit

  • What is the name of my computer

    What is the name of my computer?

  • Page property Supported User Agents can't be changed

    Hi SDN. In my EP6 sp2 patch 41 my Pages have the property Supported User Agents set to "(Netscape,,) (Mozilla,,). I can't change it to (MSIE...........). If I change and Save, then it goes back to Netscape.......... Even if I transport a Page from an