PEMOSER

   {RANGESUBSELECT 
   :lateral false 
   :subquery 
      {SELECT 
      :distinctClause <> 
      :intoClause <> 
      :targetList (
         {RESTARGET 
         :name <> 
         :indirection <> 
         :val 
            {COLUMNREF 
            :fields ("r" 
               {A_STAR
               }
            )
            :location -1
            }
         :location -1
         }
         {RESTARGET 
         :name *P1* 
         :indirection <> 
         :val 
            {MINMAX 
            :minmaxtype 0 
            :minmaxcollid 0 
            :inputcollid 0 
            :op 0 
            :args (
               {COLUMNREF 
               :fields ("r" "ts")
               :location -1
               }
               {COLUMNREF 
               :fields ("s" "ts")
               :location -1
               }
            )
            :location -1
            }
         :location -1
         }
         {RESTARGET 
         :name *P2* 
         :indirection <> 
         :val 
            {MINMAX 
            :minmaxtype 0 
            :minmaxcollid 0 
            :inputcollid 0 
            :op 1 
            :args (
               {COLUMNREF 
               :fields ("r" "te")
               :location -1
               }
               {COLUMNREF 
               :fields ("s" "te")
               :location -1
               }
            )
            :location -1
            }
         :location -1
         }
      )
      :fromClause (
         {JOINEXPR 
         :jointype 1 
         :isNatural false 
         :larg 
            {RANGESUBSELECT 
            :lateral false 
            :subquery 
               {SELECT 
               :distinctClause <> 
               :intoClause <> 
               :targetList (
                  {RESTARGET 
                  :name <> 
                  :indirection <> 
                  :val 
                     {COLUMNREF 
                     :fields (
                        {A_STAR
                        }
                     )
                     :location -1
                     }
                  :location -1
                  }
                  {RESTARGET 
                  :name *RN* 
                  :indirection <> 
                  :val 
                     {FUNCCALL 
                     :funcname ("row_number")
                     :args <> 
                     :agg_order <> 
                     :agg_filter <> 
                     :agg_within_group false 
                     :agg_star false 
                     :agg_distinct false 
                     :func_variadic false 
                     :over 
                        {WINDOWDEF 
                        :name <> 
                        :refname <> 
                        :partitionClause <> 
                        :orderClause <> 
                        :frameOptions 530 
                        :startOffset <> 
                        :endOffset <> 
                        :location 0
                        }
                     :location -1
                     }
                  :location -1
                  }
               )
               :fromClause (
                  {RANGEVAR 
                  :schemaname <> 
                  :relname r 
                  :inhOpt 2 
                  :relpersistence p 
                  :alias <> 
                  :location 22
                  }
               )
               :whereClause <> 
               :groupClause <> 
               :havingClause <> 
               :windowClause <> 
               :valuesLists <> 
               :sortClause <> 
               :limitOffset <> 
               :limitCount <> 
               :lockingClause <> 
               :withClause <> 
               :op 0 
               :temporalType 0 
               :temporalTs <> 
               :temporalTe <> 
               :all false 
               :larg <> 
               :rarg <>
               }
            :alias 
               {ALIAS 
               :aliasname r 
               :colnames <>
               }
            }
         :rarg 
            {RANGEVAR 
            :schemaname <> 
            :relname s 
            :inhOpt 2 
            :relpersistence p 
            :alias <> 
            :location 30
            }
         :usingClause <> 
         :quals 
            {BOOLEXPR 
            :boolop and 
            :args (
               {AEXPR  
               :name ("=")
               :lexpr 
                  {COLUMNREF 
                  :fields ("r" "b")
                  :location 35
                  }
               :rexpr 
                  {COLUMNREF 
                  :fields ("s" "d")
                  :location 39
                  }
               :location 38
               }
               {AEXPR  
               :name ("\<")
               :lexpr 
                  {COLUMNREF 
                  :fields ("r" "ts")
                  :location -1
                  }
               :rexpr 
                  {COLUMNREF 
                  :fields ("s" "te")
                  :location -1
                  }
               :location -1
               }
               {AEXPR  
               :name (">")
               :lexpr 
                  {COLUMNREF 
                  :fields ("r" "te")
                  :location -1
                  }
               :rexpr 
                  {COLUMNREF 
                  :fields ("s" "ts")
                  :location -1
                  }
               :location -1
               }
            )
            :location -1
            }
         :alias <> 
         :rtindex 0 
         :largTs <> 
         :largTe <> 
         :rargTs <> 
         :rargTe <>
         }
      )
      :whereClause <> 
      :groupClause <> 
      :havingClause <> 
      :windowClause <> 
      :valuesLists <> 
      :sortClause (
         {SORTBY 
         :node 
            {COLUMNREF 
            :fields ("*RN*")
            :location -1
            }
         :sortby_dir 0 
         :sortby_nulls 0 
         :useOp <> 
         :location -1
         }
         {SORTBY 
         :node 
            {COLUMNREF 
            :fields ("*P1*")
            :location -1
            }
         :sortby_dir 0 
         :sortby_nulls 0 
         :useOp <> 
         :location -1
         }
         {SORTBY 
         :node 
            {COLUMNREF 
            :fields ("*P2*")
            :location -1
            }
         :sortby_dir 0 
         :sortby_nulls 0 
         :useOp <> 
         :location -1
         }
      )
      :limitOffset <> 
      :limitCount <> 
      :lockingClause <> 
      :withClause <> 
      :op 0 
      :temporalType 1 
      :temporalTs 
         {COLUMNREF 
         :fields ("r" "ts")
         :location -1
         }
      :temporalTe 
         {COLUMNREF 
         :fields ("r" "te")
         :location -1
         }
      :all false 
      :larg <> 
      :rarg <>
      }
   :alias 
      {ALIAS 
      :aliasname x 
      :colnames <>
      }
   }



PEMOSER x

