In a large bowl, whisk together flour, sugar, and salt. Add the cold, cubed butter and use a pastry cutter or your hands to cut it into the flour until the mixture resembles coarse crumbs. Gradually add ice water, stirring just until the dough comes together. Divide the dough into two pieces (one slightly larger than the other), flatten into discs, wrap in plastic wrap, and refrigerate for at least 1 hour.
In a large bowl, toss the sliced apples with both sugars, cornstarch, cinnamon, nutmeg, lemon juice, and vanilla. Let sit for 10–15 minutes to allow the flavors to meld and the apples to release some juices.
Preheat oven to 375°F (190°C). On a floured surface, roll out the larger dough disc to fit a 10x15-inch rimmed sheet pan, leaving some overhang. Gently press the crust into the pan. Pour the apple filling evenly over the crust and dot with butter. Roll out the second piece of dough and place it over the apples. You can lay it whole or cut strips to create a lattice. Trim and crimp the edges to seal. Whisk together egg and water, then brush the top crust with egg wash. Sprinkle with coarse sugar if desired.
Bake for 45–50 minutes, or until the crust is golden brown and the filling is bubbling. Let the pie cool in the pan for at least 30 minutes before slicing into squares. Serve warm or at room temperature.