orbeon / orbeon-forms

Orbeon Forms is an open source web forms solution. It includes an XForms engine, the Form Builder web-based form editor, and the Form Runner runtime.
http://www.orbeon.com/
GNU Lesser General Public License v2.1
514 stars 220 forks source link

Performance issues with Oracle and HTTP ranges #5978

Open obruchez opened 1 year ago

obruchez commented 1 year ago

This is an issue arising from #5946 (video component). Currently, with Oracle, we can only read 2000 bytes at a time from an attachment if an HTTP range is specified, which leads to really bad performances.

obruchez commented 1 year ago

Could we do something similar to the following example?


    p_id NUMBER  -- Assuming you're using an ID or some criteria to select the row
) RETURN BLOB IS
    l_source_blob BLOB;
    l_dest_blob BLOB;
    l_amount NUMBER := 100;  -- Amount of data to extract
    l_offset NUMBER := 1;    -- Starting position
BEGIN
    -- Select the BLOB data based on the criteria
    SELECT blob_column
    INTO l_source_blob
    FROM your_table
    WHERE id = p_id;  -- Adjust the WHERE clause as needed
-- Create a temporary BLOB for the extracted data
    DBMS_LOB.CREATETEMPORARY(l_dest_blob, TRUE);

    -- Copy the desired portion from the source BLOB to the destination BLOB
    DBMS_LOB.COPY(l_dest_blob, l_source_blob, l_amount, 1, l_offset);

    -- Return the extracted BLOB
    RETURN l_dest_blob;
END extract_blob;```