Wednesday, August 10, 2005

Why You Should NOT Publish Large Worksheets to Portal

The Discoverer Portlet Provider allows users to publish Discoverer worksheets to Oracle Portal - tables, crosstabs, graphs, and as gauges. One mistake that I have seen users do, though less frequently now than before, is to assume that what does the job as a worksheet in Plus or Viewer will also work just as well when published to Portal. Specifically, I am talking about taking large worksheets and publishing them to Portal. This is bad design and even worse for performance. Let's see with a simple example. Below is a simple crosstab that ships with the Video Stores schema in Discoverer, 'Conditional Formats', from the 'New Features Examples' workbook. I have published this to a Portal page as as worksheet portlet.

One of the standard Discoverer Video Stores worksheets, published as a worksheet portlet.

This is the OC4J_BI_Forms memory usage before publishing the worksheet as a portlet.

OC4J_B_Forms memory usage, before publishing the worksheet.


And this is the memory usage after publishing the worksheet to Portal. The memory increase is only marginal.

Memory usage after publishing the 'Conditional Formats' worksheet to Portal. Memory usage has increased only marginally, from 47MB to 85MB.


Now let's look at a large worksheet. This is a worksheet I have created using Discoverer Plus. Yes, it is a deliberately bad design for a worksheet: too many dimensions and hierarchies, no use of page-items, no parameters to reduce the data, and for all practical purposes a very unusable sheet. It returns some 3,300 rows of data: quite useless if you want to do any analysis on the data.

I will now publish this to Portal as a worksheet portlet.

The layout of the large crosstab. If created as a table, this would return some 3,300 rows of data.


After I have published this to my portal, take a look at the portlet itself. The error message at the bottom of the portlet. No more than a thousand rows of data are cached by Discoverer in the metadata repository, so obviously 3,000 rows of data are not going to get cached. Page items would have been a much better alternative; or parameters.

More than 1000 rows of data are not cached; hence you get this message.

But more interestingly, look at the memory consumption of the OC4J_BI_Forms component, before and after publishing the portlet. It is obbious that a huge amount of memory has been taken up to publish this single portlet, right? Why?

Note the huge increase in memory!

In the Discoverer Portlet Provider, portlet data is cached in the DISCOVERER5.PTM5_CACHE table in the metadata repository database. The format of this cahce is XML. The BIBeans (table, crosstab, graph, or gauge) object that you see in Portal is created out of this cached data. It requires data to be passed to it as a DOM object.
The retrieved XML is therefore parsed to create the DOM structure. This parsing of data and creation of DOM object is a resource intensive operation. More the data, more costly is the parsing operation. So if the number of rows is huge then the amount of data parsed is a lot and can cause problems.

PTM5_Cache table in the DISCOVERER5 schema.
[Thanks to Gautam for his help on this post]


website statistics

4 comments:

Anonymous said...

If you still want to stay in the Portal environment, how about creating a link to the worksheet versus publishing as a Portlet?

Steve Houser said...

Assuming that you want to stay in the Portal interface, could you add a link to the worksheet versus publishing as a portlet? I assume that would require another login.

David Walker said...

At a project in Network Rail we have built a whole additional infrastructure to support calling discoverer, parameter passing etc. that uses links and a small bespoke portlet. My Oracle OpenWorld Presentation about has some information or if you want to know more please contact me via our website.

Asit Majmudar said...

Is there a manual way of adding records in DISCOVERER.PTM5_CACHE table? Well here's the problem we are facing. We have 10 Discoverer Portlets that that display graphs on Portal. We also have a form with two parameters. There are 250 different valid combinations. If i change the parameters, and click on Submit, I get Portlet Refreshing. I would like to have it refreshed and be ready for our users. Is there a better Solution than Web Cache (does not work right.) Thanks,
-- asit