Order by start_epoch to Speed Up Query Execution

In some cases, this seems to speed up xml_cdr loading times by ~10x.

It appears one big cause of this is the final ORDER_BY statements are very slow in PostgreSQL for timestamp fields. Ordering by start_epoch field improves query execution time in a dramatic way and should result in the same ordering.
This commit is contained in:
emaktech
2020-12-07 15:56:26 -05:00
committed by GitHub
parent 1781b3a4d9
commit c97d9e7022
+1 -1
View File
@@ -187,7 +187,7 @@
}
//create the sql query to get the xml cdr records
if (strlen($order_by) == 0) { $order_by = "start_stamp"; }
if (strlen($order_by) == 0) { $order_by = "start_epoch"; }
if (strlen($order) == 0) { $order = "desc"; }
//set a default number of rows to show