Skip to content

A raw SQL query using a custom field's already-materialized column returns 5 rows in 4 seconds, but the equivalent Lobby Data Source built by calling that same custom field's own getter FUNCTION directly in the SQL times out after 2 minutes, even for the same 5 rows. What explains the disparity, and how is it fixed?

Answer

The custom field's own getter function is likely implemented as a SELECT statement against a much heavier underlying view, full of joins and nested API/get-function calls, rather than a lightweight direct lookup. Calling that getter function repeatedly per row, once for filtering in the WHERE clause and again for the output column, multiplies out that heavy view's real cost across every row being evaluated, which is why it performs dramatically worse than referencing an already-computed column directly. The fix: rather than calling the custom field's getter function directly in the Lobby's SQL, query the SAME underlying heavy view that the getter function itself is built on directly instead, pulling the needed value as a plain column from that view rather than through a repeated per-row function call — this bypasses the redundant function-call overhead the custom field's own implementation was introducing, and can dramatically outperform the naive custom-field-based version for reporting/lobby purposes specifically.

← Browse Platform, Aurena, and customization questions