запрос например такой
Код: Выделить всё
SELECT Coalesce(vv.value,''),
Coalesce(vv0.value,''),
rw.description ,
Coalesce(vv1.value,''),
Coalesce(vv2.value,''),
Coalesce(vv3.value,''),
Coalesce(vv4.value,''),
Coalesce(vv5.value,''),
Coalesce(vv6.value,''),
Coalesce(vv7.value,''),
Coalesce(vv8.value,''),
Coalesce(vv9.value,'')
FROM lsdbo.object_reference_view rw left
join lsdbo.object_type_view tw on rw.type_id = tw.id left
join lsdbo.attrib_value_view av on rw.id = av.object_id and av.attrib_id = 100000016000000 left
join lsdbo.value_string_view vv on av.value_id = vv.id and av.attrib_id = 100000016000000 left
join lsdbo.attrib_value_view av0 on rw.id = av0.object_id and av0.attrib_id = 3000000000002 left
join lsdbo.value_string_view vv0 on av0.value_id = vv0.id and av0.attrib_id = 3000000000002 left
join lsdbo.attrib_value_view av1 on rw.id = av1.object_id and av1.attrib_id = 3000000000022 left
join lsdbo.value_string_view vv1 on av1.value_id = vv1.id and av1.attrib_id = 3000000000022 left
join lsdbo.attrib_value_view av2 on rw.id = av2.object_id and av2.attrib_id = 3000000000021 left
join lsdbo.value_string_view vv2 on av2.value_id = vv2.id and av2.attrib_id = 3000000000021 left
join lsdbo.attrib_value_view av3 on rw.id = av3.object_id and av3.attrib_id = 3000000000024 left
join lsdbo.value_string_view vv3 on av3.value_id = vv3.id and av3.attrib_id = 3000000000024 left
join lsdbo.attrib_value_view av4 on rw.id = av4.object_id and av4.attrib_id = 3000000000023 left
join lsdbo.value_string_view vv4 on av4.value_id = vv4.id and av4.attrib_id = 3000000000023 left
join lsdbo.attrib_value_view av5 on rw.id = av5.object_id and av5.attrib_id = 3000000000025 left
join lsdbo.value_string_view vv5 on av5.value_id = vv5.id and av5.attrib_id = 3000000000025 left
join lsdbo.attrib_value_view av6 on rw.id = av6.object_id and av6.attrib_id = 3000000000041 left
join lsdbo.value_string_view vv6 on av6.value_id = vv6.id and av6.attrib_id = 3000000000041 left
join lsdbo.attrib_value_view av7 on rw.id = av7.object_id and av7.attrib_id = 3000000000042 left
join lsdbo.value_string_view vv7 on av7.value_id = vv7.id and av7.attrib_id = 3000000000042 left
join lsdbo.attrib_value_view av8 on rw.id = av8.object_id and av8.attrib_id = 3000000000043 left
join lsdbo.value_string_view vv8 on av8.value_id = vv8.id and av8.attrib_id = 3000000000043 left
join lsdbo.attrib_value_view av9 on rw.id = av9.object_id and av9.attrib_id = 3000000000062 left
join lsdbo.value_string_view vv9 on av9.value_id = vv9.id and av9.attrib_id = 3000000000062
where rw.type_id = tw.id and
rw.id =4000000024410 -- единственный параметр id объекта
как средствами SQL можно разогнать данный запрос?
с одной стороны сделать свой View без проверки прав - но в вид нельзя передать параметр?
с другой стороны может хп свою сделать которая будет создавать вид?
что посоветуете?
нужна максимальная скорость + передача одного параметра + возврат таблицы