The following query takes quite take minutes on Teamleader:
select /*+ http_disk_cache(false) http_memory_cache(false) */ *
from V2Flat.Companycustomfieldvalues
limit 1
Whereas the exploded view runs in less than one second:
select /*+ http_disk_cache(false) http_memory_cache(false) */ cfd.type
cfd_type
, cfd.label
cfd_label
, cfd.group
cfd_group
, cfd.required
cfd_required
, cpydet.* prefix with 'cfe_'
, cpy.* prefix with 'cpy_'
from Teamleader.V2.companies cpy
join Teamleader.V2.CustomFieldsByCompanyId(cpy.id) cpydet
on ( cpydet.value_as_string is not null
or
cpydet.value_as_number is not null
or
cpydet.value_as_number is not null
or
cpydet.value_as_array is not null
or
cpydet.value_as_boolean is not null
or
cpydet.value_object_id is not null
)
join Teamleader.V2.CustomFieldDefinitions cfd
on cfd.id = cpydet.definition_id
limit 1
It seems that limit 1
is not projected into the view definition.