A Lagrangian fluctuation–dissipation relation has been derived in a previous work to describe the dissipation rate of advected scalars, both passive and active, in wall-bounded flows. We apply this relation here to develop a Lagrangian description of thermal dissipation in turbulent Rayleigh–Bénard convection in a right-cylindrical cell of arbitrary cross-section, with either imposed temperature difference or imposed heat flux at the top and bottom walls. We obtain an exact relation between the steady-state thermal dissipation rate and the time $\unicode[STIX]{x1D70F}_{mix}$ for passive tracer particles released at the top or bottom wall to mix to their final uniform value near those walls. We show that an ‘ultimate regime’ with the Nusselt number scaling predicted by Spiegel (Annu. Rev. Astron., vol. 9, 1971, p. 323) or, with a log correction, by Kraichnan (Phys. Fluids, vol. 5 (11), 1962, pp. 1374–1389) will occur at high Rayleigh numbers, unless this near-wall mixing time is asymptotically much longer than the free-fall time $\unicode[STIX]{x1D70F}_{free}$. Precisely, we show that $\unicode[STIX]{x1D70F}_{mix}/\unicode[STIX]{x1D70F}_{free}=(RaPr)^{1/2}/Nu,$ with $Ra$ the Rayleigh number, $Pr$ the Prandtl number, and $Nu$ the Nusselt number. We suggest a new criterion for an ultimate regime in terms of transition to turbulence of a thermal ‘mixing zone’, which is much wider than the standard thermal boundary layer. Kraichnan–Spiegel scaling may, however, not hold if the intensity and volume of thermal plumes decrease sufficiently rapidly with increasing Rayleigh number. To help resolve this issue, we suggest a program to measure the near-wall mixing time $\unicode[STIX]{x1D70F}_{mix}$, which is precisely defined in the paper and which we argue is accessible both by laboratory experiment and by numerical simulation.