SELECT 
    'vw_lotes_morosidad_505' as view_name,
    count(*) as total_records,
    ST_GeometryType(geom) as geom_type,
    ST_SRID(geom) as srid,
    sum(case when ST_IsValid(geom) then 1 else 0 end) as valid_geometries,
    sum(case when geom IS NULL then 1 else 0 end) as null_geometries
FROM public.vw_lotes_morosidad_505
GROUP BY 1, 3, 4;
