Insert times grow exponentially

Hello everyone
We want to store (lots of) performance data into a database and we are evaluating also berkeley JE. Basically there are devices and performance data types and an m:n relationship, so n types can be measured per device. Values of the performance data (kpi) are stored together with the timestamp when the measurement happened. What I want to get back from the database, is the performances data of one type of a device over a timerange (which are the values for objId/kpiId pair between two timestamps).
The classes I use are the following:
@Persistent
public class KpiKey implements Serializable {
     @KeyField(1) Long objId;
     @KeyField(2) Long kpiId;
     @KeyField(3) Date ts;
@Entity
public class KpiEntry implements Serializable {
     @PrimaryKey
     private KpiKey kpiKey;
     private Double value;
}Now I found out that inserting new values is linear in time, as long as the KpiKey stays ascending, when inserting new values, i.e. when objId and kpiId are constant and only ts grows (~3.5s per 100'000 inserts).
When I start to randomize objId and kpiId and keep ts ascending, the insert times grow exponentially, starting with 3.5s per 100'000 entires for the first 2'000'000 and grow up to 165s per 100'000 entries between 2 and 4 million entries.
Do you have any recommendations how to optimize this?
Thank you very much in advance.
James

>
So I think this is more a conceptual issue then a configuration issue.
Could another approach with a different primary key configuration maybe solve this issue? Since I don't want to store entites, but values into the DB, a composite key will probably be the only solution - or am I wrong?
>
Each record needs a unique key. Since you need to perform lookups by all the fields in your key, I believe your schema is correct.
One thing that may be working against you is that you are storing very small records, and there is a per-record overhead. If you were to group multiple values into a single record (same kpiId, same objId, but a range of timestamps) you may see a performance benefit. However, this only makes sense if you always operate on a range of timestamps, and don't need to delete or modify individual values. Just a thought, in case you hadn't tried it.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Inserting time in motion 1

    Hi,
    I'm working in motion 1 and need to lengthen a section. I can insert time, but all regions after the inserting are then moved into new layers that are suffixed with '1'. If I do this several times, my project will be a complete mess. The insert time command also just inserts time - it does lengthen the selections, making me have to select all of the latter regions and try to match them up with the end of the cut, which is a pain.
    Suppose I could export to final cut and find a way to lengthen the sections there.
    This program is constantly crashing on me as well. Maybe I need to reinstall. I'd love to buy a new version of motion...but I can't. I don't have a grand laying around to blow on the entire suite. I don't see why apple can't sell separates like everyone else.

    Hi,
    But in this case user has to input entire date and time. Actually I have three fields
    schedule_date - this shoud stores the date- data type : DATE
    from_time - this should store start time for schedule date - data type : TIMESTAMP
    to_time - this should store end time for schedule date - data type : TIMESTAMP
    for eg. 18-MAR-2009, 9.10, 11.25.
    I want user to enter only time in from_time and to_time.
    I have tried setting format to HH24:MI but then it stores 1-MAR-2009 9:10:00:0000AM in from_time instead it should store 18-MAR-2009 9:10:00:0000AM in from_time and same with to_time.
    Regards
    Trusha
    Edited by: trusha on Mar 18, 2009 5:01 PM

  • Query on deletion of duplicate data based on insertion time

    Hi All,
    I have loaded nearly 3 crore records in a table using SQL*Loader
    (There are four datafiles)
    Nearly 10 Lakhs records of a particular data file are duplicated on the database due to loading it by mistake another time.
    Table has no constraints defined on it.
    I know the approximate insertion time of the records.
    Is there any way to find the rows based on insertion time and delete those duplicate rows?
    Thanks,
    Kishore

    What version of Oracle? If you are on 10g and you created the tables to enable row movement and the loads were relatively recent, you may still be able to convert the ORA_ROWSCN pseudocolumn to a time and identify the rows that way. If you're on an earlier version, you didn't specify ENABLE ROW MOVEMENT when you created the table, or you did the load some time ago, you're probably out of luck.
    If you're in ARCHIVELOG mode and you were doing logged loads and you still have the archived logs from the time period in question, you may be able to use LogMiner to identify the rows in question. I'd wager, though, that it would be faster just to query the table looking for duplicate rows and delete those rows.
    Justin

  • Cut/insert time snip edit problem

    My problem is getting a 2 bar block of all tracks in arrange window to simply cut and have the right half butt upto the left, Removing 2 bars closing the gap. I select every visible region (audio/midi) for two bars, hit set locators by regions command, then snip command, but error says not all regions are selected, well I know some are hidden and I have folders closed, that shouldn't make a difference ? I choose not to abort then the results are unfavorable, I see some regions shift but not all ? This seems like a very basic function that's not happening by following reference manual. Any ideas please ?
    G5 Dual 2.7   Mac OS X (10.4.3)  

    For the snip function (Arrange Window's local menu: Region > Cut/Insert Time > Snip: Cut Time and Move by Locators) to work properly you need to first select the concerned Regions:
    • The Region you intend to snip +
    • The Region you intend to move (when you don't want to move all the Regions after the right locator)
    To avoid that dialog when doing a regular snip (the whole arrangement after the right locator shifts forward), just press Command-A (select all regions) and then go to Arrange Window's local menu: Region > Cut/Insert Time > Snip: Cut Time and Move by Locators.
    G5 Dual 1.8GHz - Logic Pro 7.1   Mac OS X (10.3.5)  
    G5 Dual 1.8GHz - Logic Pro 7.1   Mac OS X (10.3.5)  
    G5 Dual 1.8GHz - Logic Pro 7.1   Mac OS X (10.3.5)  

  • Insert time/frames shortcut?

    Hello,
    Is it possible to insert time from where the 'Current Time Indicator' is  across all layers?
    So it would extends all the layers and move all the keyframe accordingly..
    In the adobe flash days pressing F5 would achieve the same effect.
    So using this image as an example, pressing F5 would extends the layers/move all the keyframes after the indicator by one frame...
    Hope the above makes sense
    Many thanks for you help in advance

    You're right, though, this is a massive pain. The more complex a project gets, the more you start dreading having to tweak timing in the middle.
    The first thing I do when I need to add some time to the middle of a complicated composition is I sit back and have a long hard think about whether there is any way, any way at all, that I can avoid having to add time to the middle of my my complicated composition.
    What's so frustrating, though is that 90% of the work is repetitive stuff that would be trivial to implement.
    Even a simple tool, that just let you automatically select and drag:
    - all layers that start after the playhead
    plus
    - in layers currently under the playhead, all keyframes from here to the end, AND the layer end handle
    Drag that combo back and forward to your heart's content. That'd take so much of the pain away. It's a blunt tool - you may well have to either go back and fix things that were actually in motion at the cut, or prepare by putting keyframes round the cut point beforehand. Dragging back may cause some fun keyframe clashes if you're not careful.
    But most importantly, it would make it trivial to drag a bit forward, a nudge back to get pacing just right - something that you just cannot do when every nudge currently takes several tediously careful ops to do...
    And yes, you'd still have to go and correct any subcomps, but wouldn't that be a quicker job with a tool like this?
    I'll stick this in a suggestion box if I can find one, but it seems like one of those things that's so bloody obvious and would make everyone's life so much easier that there's gotta be a reason Adobe haven't done it already. Like Apple taking half an eon to admit that ALL windows ought to be resizeable from their edges. Grrr
    Sorry for the rant. One of those days.

  • Insert Time

    Hello,
    I would like to insert Time in one of the tables. Is there a time function that i can use to do it. I know there is one for Date i.e To_Date but i want only for time.
    Thanks!
    Kiran Verma

    Oracle date columns always include a time. You just can't see it if you use the default date format. If you save SYSDATE to a column the time is saved. In order to see it, you have to use TO_CHAR(date_col, 'hh:mi:ss'). If you only want to save time, not date (I give up... why do you want to?) you would save them in a VARCHAR2 column with:
    INSERT INTO the_table (time_col)
    VALUES (TO_CHAR(sysdate, 'hh:mi:ss')
    which would give you hours, minutes, and seconds. If you wanted to save military time as a number you would:
    INSERT INTO the_table (time_col)
    VALUES (TO_NUMBER(TO_CHAR(sysdate, 'hh24mi'))
    Hope this helps.
    Best!
    Randall
    null

  • Slow Execution Time of Exponentia​l Function

    Hi,
    I am developing a program with large dataset (arrays size of around 1000*1000 elements).
    I realised that my program ran quite slow when calculating exponential for each array elements.
    So, I built a simple porgram to test the execution time for exponential vs multiplication on 1000*1000 array elements and found
    out that the period is ~25 times longer. Attached is the program (Labview 2011).
    The specs of my system are:
    1) Windows 7
    2) Intel i5 3Ghz with 4gb ram
    3) Labview 2011
    The actual program I built has a version in Matlab and uses exponential function as well. However, the execution time in Labview is around 10 times longer than the Matlab. I believe that the exponential function is the cause of this after making some analysis using built-in "Performance and Memory" tool and modification to the program.
    Is there any way I could make the exponential function runs faster? Or any better way to handle large array operation? (I have tested array operations with nested FOR loops and paralel execution but the results is not that great.
    Hope anyone can help. Thanks for any input.
    Attachments:
    Execution Time-Exponential Function.vi ‏11 KB

    Thank you for your answer. 
    I am sorry, I could not upload the real code since it is large and has lots of dependency. But, I wrote simple program both in Labview and Matlab as attached.
    I tried to make both program doing the same thing and put each element as random number between 0-1 to avoid any folding/optimization process.
    The Labview took around 974ms to complete the task while the matlab 177ms. If the the way I implemented them are correct, the Matlab is around 5 to 6 times faster than Labview to execute Exponential function.
    Attachments:
    Matlab Exponential Test.PNG ‏19 KB
    Labview Exponential Test.PNG ‏24 KB
    Exponential Test.vi ‏10 KB

  • Insert Time Help

    Here's what I want to do: insert time into the middle of a project so I can add some new content. I understand the cmd-opt drag to make a region to insert time. But what I would like to have happen is a kind of "ripple insert time", meaning everything following the inserted time would move without splitting everything into new regions after the insert. Also, I'd like any keyframes and markers to move to stay in sync with all the moved content. Essentially like dropping a slug into a Final Cut project.
    As near as I can tell you can't get there from here. Anyone know otherwise?

    For this reason (Motion is not an editor), I usually do my build and layering in an FCP timeline, then send it to Motion. I often don't use the Embed Motion content checkbox, then I place the resultant Motion project on the timeline in FCP above the elements. If I need to make changes to the relationship of the elements, I copy the timeline, make the changes and send them back to Motion.
    It may be some extra work, but it's easier to do the arranging/timing in FCP for me...
    Patrick

  • Methods of Cut/Insert time during sustains

    I can recall in the now defunct sequencer Studio Vision (and I think this may also apply in DP), when you cut or inserted time in the timeline--globally in the arrange window--any sustained notes (such as pads) occuring at the point of the operation would automatically lengthen or shorten in a corresponding manner to the cut or insert time operation. It was marvelously convenient and quick.
    Because Logic is operating only on encapsulated regions in the arrange window, it makes no such adjustments to the durations of the notes within and I find that every time I do some kind of global operation like this, I have to spend some time to readjust sustained notes on all affected tracks so they are no longer either too long or too short by the amount of time of the cut or insert. This is not such an issue with beats, drums, and so on, but it's a big deal with pads, strings, piano with sustain pedals, and so on.
    Since using Logic for 15 years, I'm not particularly hopeful that I'll suddenly find a new way of dealing with this problem, and have just gotten used to this extra step. But I'm certainly open to any brilliant new workarounds anyone might have that I haven't thought of or discovered.
    Thanks.

    Transform templates might be a little quicker, although probably not, because I can usually do nudge duration key commands pretty fast which are also set in these standard increments. If you select a bunch of regions and can do one operation, that would be faster, but I don't see how you could easily just affect those notes that needed adjusting without changing all or most of the others. Then all the notes inside would be affected by a duration transform, so you're still faced with manually selecting only those notes that have been adversely affected by the operation (in each region separately) and readjusting them. I don't mind too much if it's just a track or two, but it can get to be a hassle when dealing with dozens of tracks.
    If the music was working as is, but you just wanted to lengthen or shorten some part of it, there isn't any need to have a unique circumstance for each patch in the sense that if I cut a 1/4 note out of a sustain from a global cut time command, then everything just needs to have a duration changed by the same 1/4 note amount over the cut or insert, and the music will sound exactly the same except that it will be shorter in one spot by 1/4 note. I deal with this situation all the time in film scoring.
    What is relevant here is the connections between the notes and how much overlap (or lack thereof) there is, and that musical relationship remaining constant.
    Imagine you do a mockup of a multitrack string piece which has a lot of long sustained notes and legato phrases. And you just want to take a quarter note out of the middle of the piece. What do you do?
    You find the spot.
    Do a global cut time. Causing the regions to separate and move.
    You "merge regions" for all the tracks in question because they are now separated.
    Now you can clearly see the notes over that section are a 1/4 note too long in duration and will overlap with the next notes.
    So you go through every track and manually shorten them by 1/4 note.
    What if Logic just did this step automatically?
    As I said, I did not have to do that in SV or DP, or you could think of it somewhat like taking a razor blade to a piece of analog tape (albeit without editing glitches). Logic does this with audio tracks-yes--but not with MIDI tracks.
    When doing global cut/insert time commands, Logic at the moment cares only about the movement of Larger chunks of data (regions). It does not look internally at the effects of these operations so it only adjusts start times of MIDI events, but not durations. Music consists of both. This is what I'd like to see changed, or at least offered as an alternative mode. Ideally, MIDI regions would never actually be cut in this mode, but rather the notes adjusted internally and the regions in the arrangement simply resized/moved respectively to reflect the time inserted or cut from the global timeline.

  • How to find out insertion time of records in an oracle table

    Hi everybody,
    I have a table with about 50,000 records in my Oracle database and there is a date column which shows the date that each record get inserted to the table, for example 04-Aug-13.
    Is there any way that I can find out what time each record has been inserted?
    For example: 04-Aug-13 4:20:00 PM. (For my existing records not future ones)
    I searched over the internet and find some results but none of them seem to be practical.
    Thanks for your help.

    I have a table with about 50,000 records in my Oracle database and there is a date column which shows the date that each record get inserted to the table, for example 04-Aug-13.
    Is there any way that I can find out what time each record has been inserted?
    For example: 04-Aug-13 4:20:00 PM. (For my existing records not future ones)
    First you need to clarify what you mean by 'the date that each record get inserted'.  A row is not permanent and visible to other sessions until it has been COMMITTED and that commit may happen seconds, minutes, hours or even days AFTER a user actually creates the row and puts a date in your 'date column'.
    Second - your date column, and ALL date columns, includes a time component. So just query your date column for the time.
    The only way that time value will be incorrect is if you did something silly like TRUNC(myDate) when you inserted the value. That would use a time component of 00:00:00 and destroy the actual time.

  • Insert Time and Date into Microsoft Access from Lookout

    I have an SQLExec running to export data to Microsoft Access - I would like to get A) A time stamp also to insert and B) A time stamp with out / and : -- I have found it impossible (from my limited knowledge) to do any of these things.
    Dose anyone have a very basic SQL Statement that might guide me on my way?
    Thanks!

    Oracle stores date and time in a DATE column; it all depends on how you have your insert statement. The last insert I specified the date and time
    ex.
    insert into test_date values(1,sysdate);
    insert into test_date values(2,sysdate-10.9);
    insert into test_date values(3,sysdate-8.098 );
    insert into test_date values(4,sysdate-5.11 );
    insert into test_date values(5, trunc(sysdate));
    INSERT into test_date values(6, to_date('01-JAN-2004 19:30', 'DD-MON-YYYY HH24:MI') );
    select * from test_date ;
    ID DDATE
      1 25-FEB-04
      3 17-FEB-04
      4 20-FEB-04
      5 25-FEB-04
      2 14-FEB-04
      6 01-JAN-04I don't see the time because the NLS_DATE_FORMAT is set to DD-MON-YY, but if I
    Select id, to_char( ddate , 'DD-MON-YYYY HH24:MI:SS AM') from test_date;
    ID TO_CHAR(DDATE,'DD-MO
    1 25-FEB-2004 06:57:02
    3 17-FEB-2004 04:37:05
    4 20-FEB-2004 04:20:02
    5 25-FEB-2004 00:00:00
    2 14-FEB-2004 09:24:50
    6 01-JAN-2004 19:30:00

  • Insert time stamp in ASCII file

    Hi all!
    I am trying to log data values from several channels (so far 4) into one ASCII file including a time stamp in the first column.
    The goal is one file that contains one time stamp per row (in the first column) and one column per channel. It may looks like this:
    TIME  Ch1  Ch2  Ch3  Ch4
    t1        a1     b1     c1    d1
    t2        a2     b2     c2    d2
    I want to save one row (time stamp and 4 channels) each minute as above into the same file. Nice would be to creat a new file each day.
    Problems:
    1. Using the "Save to ASCII/LVM" step: How can I get SignalExpress to insert a time stamp in the first column of each row?
        I have no problem inserting the 4 signals that generate me one column per signal. And using "Overwrite once, then append to file" I get one file for all signals.
        Any idea how to insert a time stamp this way? Or how to creat a new file every 24 hours?
    2. Another way I tried is to use the "Recording Option". But how can I get all the four signals saved in one file?
        After the DAQmx acquisition step I process the 4 channels individually (one scaling step and one threshold step per channel - because of different factors per channel).
        Activating the Recording Option (which would generate a new file every 24 hours, but not starting at 12pm each day...) I get 4 single TDMS-files (and their corresponding tdms_index and meta.txt files),
        one file per signal I am recording. I assume this is because they are 4 individual signals I'm recording and not a group of signals. Can I group individual signals together?
    Thanks for your help
    SSC
    PS: I work with SignalExpress 2.5 and have a NI USB-6210 connected.

    In the recording options tab you can set a stop condition to be 24 hours of data.  And then select the "Restart Log Automatically" option to start logging for another 24 hours.  You can also configure the logging to auto create an ASCII file once logging stops.  With this configuration an ASCII file will be created every 24 hours.  To enable ACSII file generation, select Tools>>Options.. And then set "Automatically export log to ASCII file to true".
    I believe that you will get one ASCII file for each TDMS file.  If you are logging 4 channels from the same device you should be able to log the entire group which would allow you to get only 1 TDMS / ASCII file.

  • How to reduce insert time

    I have to insert and update nearly 1000 records in Oracle, when user clicks "Save" button, but this is taking approx. 2mins, and the user has to wait for these 2mins, with out any operation. Is there any chance that i can reduce this time. I am using prepared Statement and batch statements. but still it is really slow... can ideas???

    Using Oracle, you can set the fetchSize (number of rows sent during a single network round trip) to be greater then the default, which I think is either 10 or 100 (sorry, I don't remember). This may limit (it is only a suggestion to the driver) the total number of round trips executed on the network and could result in a minor speed up of your insert processing. My suggestion would be to set fetchSize at or above your expected Batch size.
    PreparedStatements should in most cases be faster, not slower for insert processing. Your results don't identify that to be true in your case. Are you using PreparedStatements within Batch processing, or are you running them individually (they should be within Batch processing).
    You mention updates, not just insert processing. Updates can be optimized by ensuring correct use of indexes on the table(s) you are updating. Use of a PreparedStatement can alter the path the optimizer chooses when executing the update when contrasted against Dynamic SQL, but the 10-15 second difference does not point me in that direction.
    Again, best of luck.

  • How to insert time line

    In iMovie 10 how do I insert a time line reference.  In the attached photo I downloaded a movie file in which the time line shows up.  On the 2nd photo which is my clip the time line does not show up.  Thanks.

    Hey gator12345,
    Thanks for the question. The markers you see in your first screenshot have time references for the start of each clip. Because your second screenshot is one long clip, that is why you do not see (or have the option to add) a reference point. You can split the clip to add time references to the thumbnails.
    Timeline
    The area in the iMovie window where you create your movie by adding and arranging clips and making all your edits.
    Each clip in the timeline is represented by a thumbnail or series of thumbnails.
    via iMovie Help: timeline
    http://help.apple.com/imovie/mac/10.0/#mov4f95d4de6
    If you are interested in more advanced timeline editing, you may want to look into Final Cut Pro X:
    Apple - Final Cut Pro X - Overview
    https://www.apple.com/final-cut-pro/
    Thanks,
    Matt M.

  • Inserting time into a podcast

    I was recording an ichat into GB3, which was very cool. GB would put the buddy icon of whoever was talking into the chapter list.
    The problem came once we were finished. I need to split out tracks to add some time to insert some music. This works fine for the iChat tracks, I just split them and moved them to the right. The problem is the podcast track. I couldn't find any way to make more space in the timeline, unless I clicked on each chapter mark and moved them. That wasn't going to work when there were a ton of chapter marks from the conversation going back and forth. And you can't click on the first chapter mark and shift click on the last one to select all of them, nor can you lasso them.
    Any idea on inserting some space in the podcast track?
    BTW, a little anecdote on starting the podcast. I had the audio chat going in iChat, and for the life of me, I couldn't figure out how to add us as tracks. I told the other person that it's a mac, if I can't figure it out, I'm trying to hard. So then I just hit the record button, and GB asked me if I wanted to record the iChats. Wow, so slick. And switching the buddy icons to who is talking is awesome.
      Mac OS X (10.4.4)  

    ... And you can't click on the first chapter mark and shift click on
    the last one to select all of them, nor can you lasso
    them.
    You can !
    In the track editor for the podcast track, you can click/shift-click in the table to select a region of chapter marks.
    You can even lasso them but you can't start the lasso on a marker, you have to start in "free space".
    Powerbook G4   Mac OS X (10.4.4)   M-Audio 410, Roland 160e, iSight

Maybe you are looking for