docs: protected void populateRuleStack( LinkedList<OptimizerRule> ruleStack,
                                        PlanHints hints ) {
          ruleStack.addFirst(ReorderSortAndRemoveDuplicates.INSTANCE);
          ruleStack.addFirst(RewritePathAndNameCriteria.INSTANCE);
          if (hints.hasSubqueries) {
              ruleStack.addFirst(RaiseVariableName.INSTANCE);
          }
          ruleStack.addFirst(RewriteAsRangeCriteria.INSTANCE);
          if (hints.hasJoin) {
              ruleStack.addFirst(AddJoinConditionColumnsToSources.INSTANCE);
              ruleStack.addFirst(ChooseJoinAlgorithm.USE_ONLY_NESTED_JOIN_ALGORITHM);
              ruleStack.addFirst(RewriteIdentityJoins.INSTANCE);
          }
          ruleStack.addFirst(AddOrderingColumnsToSources.INSTANCE);
          ruleStack.addFirst(PushProjects.INSTANCE);
          ruleStack.addFirst(PushSelectCriteria.INSTANCE);
          ruleStack.addFirst(AddAccessNodes.INSTANCE);
          ruleStack.addFirst(JoinOrder.INSTANCE);
          ruleStack.addFirst(RightOuterToLeftOuterJoins.INSTANCE);
          ruleStack.addFirst(CopyCriteria.INSTANCE);
          if (hints.hasView) {
              ruleStack.addFirst(ReplaceViews.INSTANCE);
          }
          ruleStack.addFirst(RewritePseudoColumns.INSTANCE);
          // Add indexes determination last ...
          populateIndexingRules(ruleStack, hints);
          ruleStack.addLast(OrderIndexesByCost.INSTANCE);
      }