Changeset 18400 for trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
- Timestamp:
- Jul 1, 2008, 5:40:10 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
r18388 r18400 1 1 # Copyright (c) 2004 Joshua Hoblitt 2 2 # 3 # $Id: SQL.pm,v 1. 59 2008-06-30 23:26:16jhoblitt Exp $3 # $Id: SQL.pm,v 1.60 2008-07-02 03:40:10 jhoblitt Exp $ 4 4 5 5 package Nebulous::Server::SQL; … … 211 211 AND available = ? 212 212 AND allocate = ? 213 ORDER BY free DESC 214 LIMIT 1 215 }, 216 get_replication_volume_for_ext_id => qq{ 217 SELECT 218 vol_id, 219 host, 220 path, 221 xattr, 222 total - used as free 223 FROM ( 224 -- This query works but is slow... 225 -- SELECT 226 -- mountedvol.* 227 -- FROM mountedvol 228 -- WHERE 229 -- vol_id NOT IN( 230 -- SELECT vol_id 231 -- FROM storage_object 232 -- JOIN instance 233 -- USING(so_id) 234 -- WHERE ext_id = -- 235 -- ) 236 SELECT 237 m.* 238 FROM mountedvol AS m 239 LEFT JOIN instance AS i 240 ON m.vol_id = i.vol_id 241 AND i.so_id = ( 242 SELECT so_id 243 FROM storage_object 244 WHERE ext_id = ? 245 ) 246 WHERE 247 i.vol_id IS NULL 248 ) as Foo 249 WHERE 250 used / total < ? 251 AND available = ? 252 AND allocate = ? 213 253 ORDER BY free DESC 214 254 LIMIT 1
Note:
See TracChangeset
for help on using the changeset viewer.
