Index: trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm
===================================================================
--- trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 13177)
+++ trunk/Nebulous-Server/lib/Nebulous/Server/SQL.pm	(revision 13180)
@@ -1,5 +1,5 @@
 # Copyright (c) 2004  Joshua Hoblitt
 #
-# $Id: SQL.pm,v 1.35 2007-05-03 01:49:55 jhoblitt Exp $
+# $Id: SQL.pm,v 1.36 2007-05-03 03:21:28 jhoblitt Exp $
 
 package Nebulous::Server::SQL;
@@ -53,5 +53,5 @@
     get_object          => qq{
         SELECT
-            storage_object.so_id,
+            so_id,
             ext_id,
             read_lock,
@@ -63,4 +63,21 @@
         USING (so_id)
         WHERE ext_id = ?
+    },
+    stat_object          => qq{
+        SELECT
+            storage_object.so_id,
+            storage_object.ext_id,
+            read_lock,
+            write_lock,
+            storage_object_attr.epoch,
+            storage_object_attr.mtime,
+            COUNT(instance.so_id) as instances
+        FROM storage_object
+        JOIN storage_object_attr
+            USING (so_id)
+        JOIN instance
+            USING (so_id)
+        WHERE ext_id = ?
+        GROUP BY storage_object.so_id
     },
     # Note: this sets an update lock
