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

Arrays vs Temp Table

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

    Arrays vs Temp Table

    In terms of speed, efficiency..etc, which is better?

    Yes..yes..yes.. I know, an array is not a table. We do not need to get too technical. In the end and in terms of functionality, an array will act as a temp table. So, is there any difference or advantages of one over the other?

    #2
    Re: Arrays vs Temp Table

    A good deal of the answer depends on how you intend to use the data.

    In one of my apps I keep an entire GL in a global array because I need to get to it very often, and very quick, sometimes upwards of 30,000 times in an hour. Keeping and using it in its original table caused a slowdown that was simply unacceptable.

    So, how is the data to be used?
    -Steve
    sigpic

    Comment


      #3
      Re: Arrays vs Temp Table

      So, how is the data to be used?
      Actually Steve this is more of comparison of the two to determine the pros/cons of each if any. I've thought of this issue previously and recently it came up in another thread. No such comparison that I know of is to be found in the help file.

      I agree with your assertion that array is probably faster since I envision an array as a "table on the fly". As to repetitive use of an array vs a temp table, I can not offer any opinion here not knowing how alpha handles each.

      Comment


        #4
        Re: Arrays vs Temp Table

        Steve, I'm curious. How do you maintain or verify the integrity of the array ? -- tom

        Comment


          #5
          Re: Arrays vs Temp Table

          Gabe,
          I would assume it depends on the volatility of the table involved.In Steve's example, there is basically a static nature to a chart of accounts.The speed difference between acessing elements of an array from memory should be exponentially faster than accessing records from a table on a hard drive.
          However if the table is volatile, and the array has to be constantly refreshed,
          the speed advantages of an array could be offset.
          The biggest advantage of the table is that Alpha's field rules work with tables, and working with an array will involve a lot more coding.

          Comment


            #6
            Re: Arrays vs Temp Table

            I'm not sure what you're asking Tom. I suppose, though, that the answer is that I don't do much at all. I load it in the autoexec, it's worked for all the users for years, so I don't worry about it.
            -Steve
            sigpic

            Comment


              #7
              Re: Arrays vs Temp Table

              John:
              Your comments are well taken, however; when alpha opens a table, where does it open it? Does it remain resident in the RAM negating the need for hard drive access? what if the table is too big? same goes for an array: if you initialize an array with 100,000 records, where does alpha keep these records? Can't remember if there is a limit to an array though.

              Comment


                #8
                Re: Arrays vs Temp Table

                Gabe,
                I'm sure with a little testing you could satisfy yourself on your questions
                Open a table with at least 20,000 records with an xbasic program and do about 50 random acesses to it.Time it and look at your hard drive light while the program runs.Then populate an array the same amount of records and do the same.My bet is that the table loses by quite a bit and that the hard drive light is very active during the table's random accesses.
                John

                Comment


                  #9
                  Re: Arrays vs Temp Table

                  Hey all,

                  Good points here.

                  In Clipper and VB, we never accessed the table diirectly onto a form. We made variables(later arrays), and placed them on a form. Once data entry was complete, we wrote the contents to the table. It was considered faster than directly opening a table. I always believed(and still do) that Alpha handled this for us to a great degree.

                  When we needed to edit a record, it was read into variables/arrays and again written back to the table(s) at edit end.

                  I don't know if this helps, but it was/is pretty standard.



                  Dave Mason
                  Dave Mason
                  [email protected]
                  Skype is dave.mason46

                  Comment


                    #10
                    Re: Arrays vs Temp Table

                    Strange question.... It is very simple. When I have to do math or planning stuff, approximately 2000 records, I read the table into an array. With the array I'm going to manipulate the data. Very fast. Just pure power.
                    Marcel

                    I hear and I forget. I see and I remember. I do and I understand.
                    ---- Confusius ----

                    Comment


                      #11
                      Re: Arrays vs Temp Table

                      ...and if you are reading 20,000 records? or 100,000?

                      Comment


                        #12
                        Re: Arrays vs Temp Table

                        Originally posted by G Gabriel View Post
                        ...and if you are reading 20,000 records? or 100,000?
                        As I said approximately 2000 records. But if you have enough memory where is the limit. I know databases that only exist in memory when they are up and running or database system that uses a fair amount of memory at moment it has to do some data mining and you don't even know when it claim your total memory.

                        I think it depends on the data manipulation you want to do. Slow processes, simple data keeping, archiving is not worth to keep it in memory. Fast real time information handling is best handled in memory.

                        Another take. Suppose you want to check if the contents of a text field in two identical databases DB1 is different from the same field in DB2. You can add a CRC field and calculate the CRC checksum of that field every time you change it. Do it for both db's. When you want to check for differences you only have to load the fields key and CRC of database DB1 and DB2 in an array, sort it on the key and start checking both CRC fields. If it is different you have a hit for further investigation. Very fast in memory.

                        McObject
                        KXSystems
                        Last edited by Marcel Kollenaar; 12-16-2006, 07:32 AM. Reason: were -> where
                        Marcel

                        I hear and I forget. I see and I remember. I do and I understand.
                        ---- Confusius ----

                        Comment


                          #13
                          Re: Arrays vs Temp Table

                          I believe your are now talking "Dynamic Array".

                          Dave
                          Dave Mason
                          [email protected]
                          Skype is dave.mason46

                          Comment


                            #14
                            Re: Arrays vs Temp Table

                            <array>.initialize_from_table()
                            Marcel

                            I hear and I forget. I see and I remember. I do and I understand.
                            ---- Confusius ----

                            Comment

                            Working...
                            X