Hi formspider team, The API
The table I think it would be best to minimize the number of session variables as much as possible. For example: i think it is better to create a custom table with columns for all session variables and only create one session variable that points to the record in the custom table. Then only one database call is needed to get the record with all session variables. Instead of the 30-40 calls that are currently made. Am i right about this? By the way, this insight has clarified the problems with response times with views calling api_session.getValueXX, because the optimizer can be totally mixed up. Kind regards, Jan Willem |
Hi Jan Willem, api_session.getValueXX('variable-name') calls a bdf_websessionitem_qry and it executes a SELECT query which uses a unique index. This is the fastest way to fetch a single entry. You can also call the underlying query directly to fetch as many variables as you like:
As you thought already your issue is related to the fact that you are calling these functions directly from view for multiple session variables. This slows down your query execution. As a solution, you can create a custom table with columns for all session variables, as you suggested, and a column for Formspider web session id. To tie this record to a specific session. Then you can join this table into your view. You can get web session id using bdf_support.getCurrentWebSession. Kind regards, Thanks Serdar, i am glad i understand the mechanism :) By the way, bdf_websessionitem_qry does NOT use a unique index because there is no index on session-id+variable-name. It selects on the index on the session-id and then a range scan for the variable-name. In my case often multiple variable-names are needed for queries. One select for a variable takes a fraction of a second time, but altogether all selects take a second and sometimes that's too much. Kind regards, Jan Willem
(17 Sep, 03:39)
Jan Willem V...
|
Hi Serdar, is Kind regards, Jan Willem Just to be sure... Until now i have always seen the same values.
(19 Sep, 05:48)
Jan Willem V...
Yes, it is the same value and it is a good idea to use api_session.getID API.
(19 Sep, 07:14)
Serdar ♦♦
|