Hi,
We are developing a web based reporting system using ASP, CR 8.5 (DEV) and Oracle. The system is working fine but it is very slow. It is mainly because of the complexity of the Oracle queries - there are many functions, multiple table joins, multi level dynamic views and unions in the queries. Hence the queries are mostly doing 'table scan' and there are too many complexities to solve just by indexing. (I can give you an example query that runs 3 pages !)
This is because one Crystal Reports report (.rpt file) can accept only one resultset. So a single dynamic SQL is getting all the data necessary fileds for the report. Hence the query is complex and is slow.
What are the possible ways to improve the query performance?
We are exploring the possibilities of moving the dynamic SQL from .rpt file to an Oracled stored procedure. That will eliminate the parsing time at runtime. But as per my understanding even the stored procedure can contain only one SQL, so all the complexities of the query still remain. I cannot break the query into simpler queries for optimized, indexed access. I could break the queries if Crystal Reports supported the PL/SQL tables (arrays) as return values from Stored Procedure and process them as a result set. Then I can construct the Array with appropriate cursor, looping and smaller queries and return it.
Does anyone know whether ASP can accept PL/SQL arrays for storing into a ADO result set? Then I can assign the result set as the data source for Crystal Reports. Example code or pointer to example code would really help.
Also can there be Master/Slave (Parent/Child) kind of relationship between main report and sub-reports in Crystal Reports? Then may be I can try to divide the complex report into parts and when the parent section of a report executes its SQL, subreport will fetch the corresponding data child for the child sections, automatically. If you think this could be a solution alternative, please give me an example code.
Thanks in advance for all your suggestions and help.
We are developing a web based reporting system using ASP, CR 8.5 (DEV) and Oracle. The system is working fine but it is very slow. It is mainly because of the complexity of the Oracle queries - there are many functions, multiple table joins, multi level dynamic views and unions in the queries. Hence the queries are mostly doing 'table scan' and there are too many complexities to solve just by indexing. (I can give you an example query that runs 3 pages !)
This is because one Crystal Reports report (.rpt file) can accept only one resultset. So a single dynamic SQL is getting all the data necessary fileds for the report. Hence the query is complex and is slow.
What are the possible ways to improve the query performance?
We are exploring the possibilities of moving the dynamic SQL from .rpt file to an Oracled stored procedure. That will eliminate the parsing time at runtime. But as per my understanding even the stored procedure can contain only one SQL, so all the complexities of the query still remain. I cannot break the query into simpler queries for optimized, indexed access. I could break the queries if Crystal Reports supported the PL/SQL tables (arrays) as return values from Stored Procedure and process them as a result set. Then I can construct the Array with appropriate cursor, looping and smaller queries and return it.
Does anyone know whether ASP can accept PL/SQL arrays for storing into a ADO result set? Then I can assign the result set as the data source for Crystal Reports. Example code or pointer to example code would really help.
Also can there be Master/Slave (Parent/Child) kind of relationship between main report and sub-reports in Crystal Reports? Then may be I can try to divide the complex report into parts and when the parent section of a report executes its SQL, subreport will fetch the corresponding data child for the child sections, automatically. If you think this could be a solution alternative, please give me an example code.
Thanks in advance for all your suggestions and help.