It is possible to resolve the issue by using the traditional C profiler. Compile the SQL library with profiling on the different compilers and measure where the time is spent during execution.

You can also compile some test programs and look at the assembler output to get an idea of the efficiency of the optimizer. A good optimizer can make big chunks of code disappear.

We find that thoughtfully written C runs well with or without compile optimisation. Carelessly written programs benefit strongly from optimisation to remove common sub-expressions etc. We also notice that a compiler which is specialized for a particular architecture so that it makes use of the full register file produces the best code for that machine. An example of that is the IBM XLC which produces code running 40% better than GCC on the Power machines. Someone may have a similar comparison for some Intel compilers compared to GCC as a benchmark.

For speed unrolling loops and inlining functions creates a bigger but noticeably faster executable. Since function calls are expensive in execution time, inlining them can be a big win.

Shields, Daniel wrote:
Daniel:
Thanks for the suggestion.
I wasn't aware that the prepare statement gained you that much for one-table select queries. I use it for multi-100k inserts (along with trans.) and it saves quite a bit of time.
This is my sql for the present problem:

select * from (select f1, f2, f3, f4,
f5 from Table where f2 = 'abc' and f3 = 2563351070 and f4 >= '2004-01-01'and f4 <='2006-01-01' ) order by f1 limit 32 offset 900;

Do you think that prepare would be helpful here?
Regards,
Michael



Michael,

You're right, for a single query the pre-prepared statement
will save no time. If performance is important you may get some mileage out of an optimising compiler.

http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284527.htm

Daniel.

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================


Reply via email to