Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

append speed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    append speed

    Using an append operation and appending 1 record from a table of 650 records to a table with 65,000 records takes 4.5-5 seconds. Appending the same record from the same table to an empty table is almost instantaneous. Why is this? From my relatively simple minded viewpoint it doesn't seem like there should be any difference between the two, but that's obviously not the case.

    I created the empty table by duplicating the field rules only of the master from the first example. In both cases the master and transaction tables were closed before running the operation. Is there any way to speed up the first append operation?

    ba

    #2
    Re: append speed

    Bob, is this happening on a single machine, or are you using a workstation that's talking to a server over your LAN?

    Do you normally have only one transaction record when you do the append? If so, you might be using the wrong approach. Operations are intended for batches of records. You might improve performance using a script to enter the new record directly in the master table.

    --tom

    Comment


      #3
      Re: append speed

      Hi Tom,

      I'm running this on a single stand-alone machine, and for the comparison I mentioned above I was running both operations from the control panel.

      In the application I'm using the master table to archive all record changes, so anytime someone changes a record in the transaction table that record gets appended to the master table. I can appreciate that operations are intended for batches of records, but in this case I'm just appending one each time.

      I looked at tbl.record_clone as a work-around, but I can't guarantee exclusive access to both tables. Is there another way of directly writing the changed record to the master table?

      Be all this as it may, I still don't understand why the size of the 'receiving table' should have any bearing on the speed of an append.

      ba

      Comment


        #4
        Re: append speed

        Bob:
        One possible reason is if the operation is checking for duplicates.

        Another, if you are using an expression in the appended fields.

        Comment


          #5
          Re: append speed

          Your saved append probably has to run a query in order to find the right transaction table record to append to the master. Is LQO being used to do this?

          The number and complexity of index tags on the master table could be a factor, also.

          I avoid using "operations" for this kind of thing, since the operation must open new instances of both the transaction and master tables in order to do its work. Since the transaction table is already open (in the form where the edits are made), it's faster and simpler, in my opinion, to just open the master and enter the new record.

          You may be interested in Dr. Wayne's audit trail approach, described in his Alpha Five book "Xbasic for Everyone".

          -- tom

          Comment


            #6
            Re: append speed

            The append operation is more than likely rebuilding indexes on your 65,000 record table. Try the following and see if it changes the speed. Prior to running your append open an instance of the 65,000 record table and minimize it. Then with the table still open, run your append.In this case, it shouldn't rebuild the indexes at the conclusion.See if there is a significant increase in speed.
            In the news letter archives there is an article about this written by myself. I think the subject was called speed of operations.

            Comment


              #7
              Re: append speed

              Tom and Gabriel,

              Thank you for your suggestions. I implemented as much as I could without much improvement in performance. Nevertheless, I always appreciate your thoughtful insights.

              John,

              I'd about given up on this until you chimed in. What a difference your suggestion makes! For anyone who's interested, the link to the article John refers to is:

              http://newsletter.alphasoftware.com/0020612.htm

              Interestingly enough, this newsletter article/suggestion apparently is in direct contradiction to a post from Selwyn on the V5 message board on 8/15/2002 in which he says:

              RE: Slow Append
              if Append can get an exclusive lock on the table it is appending to, then the operation will be fast.

              if Append can NOT get an exclusive lock on the table, then append is relatively slow because a5 must append one record at a time.

              you have had another instance of the table open the first time, and so the Append operation could not get an exclusive lock on the table.
              For anyone who has experienced this slowing down of an append or update operation when their master table begins take on some size, this is an incredibly useful piece of information which I'm guessing most hadn't heard of or had long since forgotten.

              John, Thank you again very much!

              ba

              Comment


                #8
                Re: append speed

                Bob,
                You are very welcome, I'm glad it helped.
                Since you were appending a single record to a fairly large table, my method was faster. If you were appending several thousand records at a time, Selwyn's suggestion would probably be faster.So, there is no real contradiction here.
                John

                Comment


                  #9
                  Re: append speed

                  Bob/John:
                  When I first read Bob's question, I had assumed that it, most likely, has to do with updating the indexes, but as I was not quite sure at what point of time alpha does that, I restricted my comments pending further research. Now I am a bit confused:

                  1-From what John says, by keeping a second instance open, alpha will append the new records and builds the indexes for the newly appended records ONLY
                  2-On the other hand, what Selwyn is saying, if another instance is open, the tardiness comes from the fact that alpha appends one record at a time.

                  Reading these two, the question is:
                  1-Is it better to open a second instance?
                  2-Is the tardiness from the append process itself? or from updating the indexes?

                  What I was attempting to research was to find out if there is a function that tells alpha to halt updating the indexes.

                  I dropped that idea, even if that function exists, simply because, you HAVE TO update the indexes and you better do that IMMEDIATELY after you append.

                  So, if the tardiness has to do with updating the indexes, then this is something you have to live with as a by-product of the size of your table and your indexes. If it has to do with the append process itself, then looking for optimization of the process would be the only question remaining.

                  Having further thoughts after reading the quote from Selwyn: if there is a function that halts the update, then you might want to try that.

                  Comment

                  Working...
                  X