Bulk percentile calculation in Postgres
The following query should get you both the percentile and the value

SELECT * FROM unnest(
  (select array_agg(fraction) from generate_series(0, 1, 0.2) AS fraction),
  (select percentile_cont((select array_agg(s) from generate_series(0, 1, 0.2) as s)) WITHIN GROUP (ORDER BY SIZE) FROM mytable)
);