Forum OpenACS Development: new-portals: package_id's - where are they from?

I'm helping in getting a dotlrn site up and running and I am looking at the Oracle Statspack reports. Its figures suggest that the Oracle Server is trashing away its time parsing statements again and again.

My first guess is that new-portals is the culprit. It sends queries with in (1234,2345,3456) - aka hard-coded values - so that Oracle has to do the parsing work over and over again.

Looking at e. g. forums-portlet.tcl I find this

set list_of_package_ids $config(package_id)

I was browsing new-portals' and forum-portlets' code to find the place and eventually the sql query that fills config(package_id). To no avail - can someone point me to the particular piece of code that computes the list of packages for a portlet?

Collapse
Posted by Dirk Gomez on

Whew - I found it. Here's the query for forums-portlet:


    and ff.package_id in
        (select pep.element_id
        from
        portal_pages pp, dotlrn_communities dc, portal_element_parameters pep, portal_element_map pem
        where community_id = :community_id
        and pem.name = 'forums_portlet'
        and pp.portal_id = dc.portal_id
        and pp.page_id = pem.page_id
        and pem.element_id = pep.element_id
        and pep.key='package_id')
Collapse
Posted by Dirk Gomez on
Alas, above query is wrong. So how can I retrieve the package_id parameteter. Here's another query that also looks promising - but is faulty as well:
select pem.element_id
            from portal_element_map pem,
                 portal_pages pp, portal_datasources pd,
                 portal_element_parameters pep
            where pp.portal_id = 2536537 --:portal_id
            and pem.datasource_id = pd.datasource_id
            and pem.page_id = pp.page_id
        and pem.element_id = pep.element_id
            and pd.name = 'forums_portlet';