   (println "************************************************************************************")
   (println "!get-query-results-v2*   REALTIME = " realtime)
 
-  (if realtime
-  (do
-  (if (get @cached-queries db-table)
+
+(cond
+   realtime
+  (let [
+  query-key   (create-query-key
+                :db-table db-table
+                :where where
+                :start start
+                :end end
+                :params params
+                :order order
+  )
+  ]
+  (if (get @cached-queries  query-key)
     nil
-    (swap! cached-queries assoc db-table {})
+    (swap! cached-queries assoc  query-key {})
   )
     (println "-------------------------------")
    (println cached-queries)
     (println "-------------------------------")
-  )
-  )
+  
+  
 
   (println (str "!get-query-results-v2: "
                 db-table

                order " "
                data-session-id " "
                realtime " "
                ))

  (let [
        record-count


     :records      result-id-vector
      :count       record-count
     }
    ))))



