SQL. Вывести таблицы с большим количеством записей в БД Firebird
select i.rdb$relation_name,
cast(1/i.rdb$statistics as integer) as RCOUNT
from rdb$relation_constraints rc
inner join rdb$indices i on (rc.rdb$relation_name=i.rdb$relation_name
and rc.rdb$index_name=i.rdb$index_name and (rc.rdb$index_name is not null)
and TRIM(UPPER(rc.rdb$constraint_type))='PRIMARY KEY'
and i.rdb$statistics>0)
ORDER BY RCOUNT DESC;
Комментарии
Отправить комментарий