Revision: 2609
          https://sourceforge.net/p/mrbs/code/2609/
Author:   cimorrison
Date:     2012-12-27 08:36:36 +0000 (Thu, 27 Dec 2012)
Log Message:
-----------
Slight performance tweak

Modified Paths:
--------------
    mrbs/branches/linked_bookings/web/functions_table.inc

Modified: mrbs/branches/linked_bookings/web/functions_table.inc
===================================================================
--- mrbs/branches/linked_bookings/web/functions_table.inc       2012-12-27 
08:32:57 UTC (rev 2608)
+++ mrbs/branches/linked_bookings/web/functions_table.inc       2012-12-27 
08:36:36 UTC (rev 2609)
@@ -747,6 +747,7 @@
   // Note: The predicate clause 'start_time <= ...' is an equivalent but 
simpler
   // form of the original which had 3 BETWEEN parts. It selects all entries 
which
   // occur on or cross the current day.
+  // ORDER BY necessary so that multiple bookings appear in the right order
   $sql = "SELECT RE.room_id AS room_id, start_time, end_time, name, repeat_id,
                  E.id AS entry_id, type,
                  E.description AS entry_description, status,
@@ -757,8 +758,9 @@
              AND R.area_id = $area
              AND R.disabled = 0
              AND start_time <= $pm7 AND end_time > $am7
-        ORDER BY start_time";   // necessary so that multiple bookings appear 
in the right order
-
+        ORDER BY start_time
+           LIMIT $n_rooms";
+  
   $res = sql_query($sql);
   if (! $res)
   {
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to