VishalMistry
18th April 2016, 11:21
Hi all,

I have written a session that exports table data along with column description. But the session performs slowly when the table has more then 10,000 rows and takes at least 5 minutes. It performs the following:

1. given a table name it writes a sequential file on server
2. once, the file is written copies it to client and opens in excel

I am attaching script of the session. Shall be grateful if someone can hint what could be the problem, or at-least suggest some alternative solution.

Vishal

andreas.toepper
18th April 2016, 12:53
Not quite sure about the performance issue, but I think you could try optimising is.enumerated().
You could fill an array indicating a row is enum or not, when filling the colum.name() array. (At least I think you could.)
So you could avoid the repeating select on ttadv400, when writing the table rows in write.record.in.file().

I don't know how time consuming calling rdi.domain() is. If you try using a type array, you could also avoid the repeating rdi.domain() call in write.record.in.file() when checking DB.DATE datatype.

Not sure if this will really speedup things in the program, but I think you could give it a try.

VishalMistry
18th April 2016, 14:32
Hi andreas,

Thanks a lot for your valuable inputs. I altogether commented the line that calls the is.enumerated function as rdi.column function has enough details about whether the field is enumerated or not. That greatly reduced the execution time of the session, still not at par my expectation, but, is greatly improved. I am trying to look into the script for where i can reduce expensive calls.

Thanks a lot again.

Vishal

JaapJD
18th April 2016, 17:22
Search the forum and/or Programmer's Manual for Call Graph Profiler. CGP provides valuable information in finding the bottlenecks in your code.