Note on binary search
authorPeter Geoghegan <[email protected]>
Wed, 12 Mar 2014 02:33:03 +0000 (19:33 -0700)
committerPeter Geoghegan <[email protected]>
Wed, 12 Mar 2014 02:33:03 +0000 (19:33 -0700)
src/backend/utils/adt/jsonb_support.c

index 5428e5a9ec0bf0b3f7bcebb2cd5e4733becc4b95..828a56830067a539932c307f8ec8ae7d54683459 100644 (file)
@@ -140,6 +140,8 @@ JsonbValueToJsonb(JsonbValue * v)
  *
  * This is a special qsort_arg() comparator used to sort strings in certain
  * internal contexts where it is sufficient to have a well-defined sort order.
+ * In particular, objects are sorted according to this criteria to facilitate
+ * cheap binary searches where we don't care about lexical sort order.
  *
  * a and b are first sorted based on their length.  If a tie-breaker is
  * required, only then do we consider string binary equality.