[mirrorbrain-commits] [opensuse-svn] r6507 - trunk/tools/download-redirector-v2/mod_mirrorbrain

From: Novell Forge SVN <noreply_at_novell.com>
Date: Thu, 19 Feb 2009 13:32:49 -0700 (MST)
Author: poeml
Date: 2009-02-19 13:32:46 -0700 (Thu, 19 Feb 2009)
New Revision: 6507

Modified:
   trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c
Log:
mod_mirrorbrain: shorten the SQL query by using table aliases (we don't save bandwidth because the query is prepared once per connection in the pool, but still)

Modified: trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c
===================================================================
--- trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c	2009-02-19 18:27:36 UTC (rev 6506)
+++ trunk/tools/download-redirector-v2/mod_mirrorbrain/mod_mirrorbrain.c	2009-02-19 20:32:46 UTC (rev 6507)
_at_@ -84,21 +84,21 @@
 #endif
 #define DEFAULT_MIN_MIRROR_SIZE 4096
 
-#define DEFAULT_QUERY "SELECT file_server.serverid, server.identifier, " \
-                             "server.region, server.country, server.asn, server.prefix, " \
-                             "server.score, server.baseurl, " \
-                             "server.region_only, server.country_only, " \
-                             "server.as_only, server.prefix_only, " \
-                             "server.other_countries, server.file_maxsize " \
-                      "FROM file " \
-                      "LEFT JOIN file_server " \
-                      "ON file.id = file_server.fileid " \
-                      "LEFT JOIN server " \
-                      "ON file_server.serverid = server.id " \
-                      "WHERE file.path=%s " \
-                             "AND server.enabled " \
-                             "AND server.status_baseurl " \
-                             "AND server.score > 0"
+#define DEFAULT_QUERY "SELECT fs.serverid, s.identifier, " \
+                             "s.region, s.country, s.asn, s.prefix, " \
+                             "s.score, s.baseurl, " \
+                             "s.region_only, s.country_only, " \
+                             "s.as_only, s.prefix_only, " \
+                             "s.other_countries, s.file_maxsize " \
+                      "FROM file f" \
+                      "LEFT JOIN file_server fs" \
+                      "ON f.id = fs.fileid " \
+                      "LEFT JOIN server s" \
+                      "ON fs.serverid = s.id " \
+                      "WHERE f.path=%s " \
+                             "AND s.enabled " \
+                             "AND s.status_baseurl " \
+                             "AND s.score > 0"
 
 
 module AP_MODULE_DECLARE_DATA mirrorbrain_module;

_______________________________________________
Opensuse-svn mailing list
Opensuse-svn_at_forge.novell.com
http://forge.novell.com/mailman/listinfo/opensuse-svn


_______________________________________________
mirrorbrain-commits mailing list

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Thu Feb 19 2009 - 20:33:20 GMT

This archive was generated by hypermail 2.3.0 : Thu Mar 25 2010 - 19:18:16 GMT