Use funções de janela para fazer isso em uma única passagem:
select *
from (
select col1,
col2,
row_number() over (order by some_column) as rn,
count(*) over () as total_count
from the_table
)
where rn <= 4;
Em tabelas muito grandes, isso pode não ser rápido, pois count(*) over () considera todas as linhas.