The structural, electronic and optical properties of halide perovskite Cs3Bi2I9 with a hexagonal perovskite-type structure under pressure were investigated using first-principles calculations. The calculated structural parameters and elastic constants at zero pressure show a good agreement with the experimental and other theoretical values. Furthermore, the calculated pressure dependence of lattice parameters a(b) and c were studied, and both of them decrease with increasing pressure in the pressure ranging from 0 to 20 GPa. These calculated results indicate that the linear compressibility along c axis is significantly higher than a and b axes, which shows that the intermolecular bonding along the c axis is softer and hence easily compressible than other crystallographic axes. The electronic structure shows the top of the valence band and bottom of the conduction band minima are dominated by Bi s and p states, respectively. According to our calculation, the band gap decreases with increasing pressure. Moreover, in optical properties such as dielectric function, absorption coefficient, reflectivity, refractive index and the extinction coefficient are calculated under pressure.