COPY_TABLE vs CREATE_TABLE (OpenInsight 32-Bit)
At 11 DEC 2003 11:53:59AM Colin Rule wrote:
I have a switch based on the runtime/dev licence to use either COPY_TABLE (run) or CREATE_TABLE (dev).
COPY_TABLE seems to take about 4-5 times as long as CREATE_TABLE.
The tables copied are all small and empty.
Why is COPY_TABLE so S…L…O…W?
If it could be faster then I would not need to even use CREATE_TABLE.
Colin Rule
At 11 DEC 2003 01:12PM Mike Ruane wrote:
Colin-
Thanks for moving the question here. We discourage Works members from posting technical questions/answers on the discussion site as it lessens the benefits of being a Works member, effectively giving away information to others who haven't paid for it.
So…
Copy_table will move and attach the dictionary, indexes, and data of a file. It also handles the attaching and detaching. It's effectively doing about 9 discrete IO commands.
Create_table will create only the data or dictionary portions, so it does less and should be faster. It's up to the developer to handle attaching, disctionaries, etc.
If you're copying temporary tables, try using a source with no indexes (which is probably already true), and no dictionary. It should be faster than it is, and nearly as fast as create_table.
Hope it helps-
Mike
At 11 DEC 2003 02:08PM David Phillips wrote:
According to the docs for copy_table, using the table name alone will copy the data, dict, and indexes. Using 'DATA.tablename' will copy only the data and using 'DICT.tablename' will copy only the dictionary.
If you specify 'DATA.tablename' or 'DICT.tablename', will either one of these copy the indexes also?
At 11 DEC 2003 05:33PM Mike Ruane wrote:
No, because you have to name the target DATA. or DICT. or else you'll get a naming inconsistency error.
So that should work as well.
At 12 DEC 2003 03:12AM Colin Rule wrote:
I only copy the data, no dicts or indexes.
COPY_TABLE("DATA.QFILE",LOCATION,"ICEPAC","DATA.":FILE,0,0,1,0,0,0)
It is slow enough (with some 80 files) to become a real issue for the user. With Create it takes about 30 secs, with Copy about 2 minutes or more, even with the NT service in place.
Colin
At 12 DEC 2003 07:28AM Mike Ruane wrote:
You're copying 80 temporary files at once?
What are you doing?
At 12 DEC 2003 12:06PM Colin Rule wrote:
Mike
My application stores information in separate folders, for each building project. Users may have from say 20 to 1000 of these.
I am creating the folder, and copying the empty tables to the folder.
The dictionaries are stored in the app, and attached once, with separate DATA files for the current attachment of any selected project.
Colin
At 19 DEC 2003 08:03PM S Botes wrote:
Bob C. had a utility program that he used to build a batch file that would then run in a command window. It in affect would copy files from one directory to another using a system copy function. We use it or something like it to copy files from one application to another when converting arev apps. It seems that you could have a set of stock files and when the need arises run this movedata program which would create your folder and populate it with new files. Then you simply attach that directory and move on…. It is very fast. We move over 300 files with it and several hundred megs of data… Let me know if you think this will work…. steve@scubaware.com