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
515 stars 221 forks source link

Optimize the Form Metadata API when a single provider is used #6577

Open obruchez opened 3 hours ago

obruchez commented 3 hours ago

Currently, all the filtering, sorting, merging, and pagination logic is implemented in the proxy. All form metadata are loaded in memory and then processed.

If no remote server is specified and only a single local provider is defined, then it might be possible to do the filtering, sorting, and pagination in SQL.

The resource provider returns an empty list of form metadata. Calling that provider first and checking that it indeed returned no form metadata should then make it possible to decide that we can optimize the request using SQL.

obruchez commented 3 hours ago

The following metadata are contained in the form_metadata column as XML:

Can we really filter/sort on those values?

obruchez commented 3 hours ago

Think about possible optimizations when multiple providers / remote servers are present ("streaming" of data with early stopping when all necessary results have been retrieved, etc.).

ebruchez commented 3 hours ago

If I remember some earlier ideas:

But if at least sorting is done in SQL, then it is possible to write a stream merging algorithm that will be as efficient as can be. With a single provider, obviously; but with multiple providers, this could pull just as much information from the providers as needed.

obruchez commented 3 hours ago

If a provider only supports version 1 of the Form Metadata API (GET requests), the proxy might also want to fallback to using GET requests and processing the results in memory as is done currently.