This article describes how open source PolarDB uses pg_rational extension to support Stern-Brocot trees to efficiently customize and adjust the order.