Index: branches/release-34/lib/MT/Blocklist.pm
===================================================================
--- branches/release-34/lib/MT/Blocklist.pm (revision 1495)
+++ branches/release-34/lib/MT/Blocklist.pm (revision 1873)
@@ -32,5 +32,5 @@
     my ($blog_id, $action, @urls) = @_;
     foreach my $url (@urls) {
-        next if $class->count({blog_id => $blog_id, text => $url});
+        next if $class->exist({blog_id => $blog_id, text => $url});
         my $this = $class->new();
         $this->set_values({blog_id => $blog_id, text => $url,
Index: branches/release-34/lib/MT/Upgrade.pm
===================================================================
--- branches/release-34/lib/MT/Upgrade.pm (revision 1866)
+++ branches/release-34/lib/MT/Upgrade.pm (revision 1873)
@@ -368,5 +368,5 @@
             updater => {
                 type => 'blog',
-                condition => sub { !(MT::Permission->count({
+                condition => sub { !(MT::Permission->exist({
                     blog_id => $_[0]->id, author_id => 0 })) },
                 code => sub {
@@ -1480,5 +1480,5 @@
 
     require MT::Author;
-    return undef if MT::Author->count;
+    return undef if MT::Author->exist;
 
     $self->progress($self->translate_escape("Creating initial blog and user records..."));
@@ -1606,5 +1606,5 @@
 
     require MT::Role;
-    return if MT::Role->count();
+    return if MT::Role->exist();
 
     foreach my $r (@default_roles) {
@@ -1673,5 +1673,5 @@
         $terms->{blog_id} = $blog_id;
 
-        return 1 if MT::Template->count( $terms );
+        return 1 if MT::Template->exist( $terms );
 
         $self->progress($self->translate_escape("Creating new template: '[_1]'.", $val->{name}));
@@ -1984,5 +1984,5 @@
     require MT::Template;
     my $dyn_error_template = 
-        MT::Template->count({type => 'dynamic_error'});
+        MT::Template->exist({type => 'dynamic_error'});
     if ($dyn_error_template) {
         return 3.1;
@@ -1990,5 +1990,5 @@
 
     my $comment_pending_template =
-        MT::Template->count({type => 'comment_pending'});
+        MT::Template->exist({type => 'comment_pending'});
     if ($comment_pending_template) {
         return 3.0;
Index: branches/release-34/lib/MT/TemplateMap.pm
===================================================================
--- branches/release-34/lib/MT/TemplateMap.pm (revision 1823)
+++ branches/release-34/lib/MT/TemplateMap.pm (revision 1873)
@@ -108,5 +108,5 @@
             $blog->save;
             for my $at ( @{ $ats{ $blog->id } } ) {
-                unless ( __PACKAGE__->count({
+                unless ( __PACKAGE__->exist({
                     blog_id => $blog->id, archive_type => $at, is_preferred => 1 
                 }) ) {
Index: branches/release-34/lib/MT/Object.pm
===================================================================
--- branches/release-34/lib/MT/Object.pm (revision 1846)
+++ branches/release-34/lib/MT/Object.pm (revision 1873)
@@ -543,7 +543,6 @@
 ## Drivers.
 
-# Note: Removed methods: set_driver
-
 sub count          { shift->_proxy('count',          @_) }
+sub exist          { shift->_proxy('exist',          @_) }
 sub count_group_by { shift->_proxy('count_group_by', @_) }
 sub sum_group_by   { shift->_proxy('sum_group_by',   @_) }
Index: branches/release-34/lib/MT/CMS/Template.pm
===================================================================
--- branches/release-34/lib/MT/CMS/Template.pm (revision 1872)
+++ branches/release-34/lib/MT/CMS/Template.pm (revision 1873)
@@ -1126,5 +1126,5 @@
     my $blog_id = $q->param('blog_id');
     my $at      = $q->param('new_archive_type');
-    my $count   = MT::TemplateMap->count(
+    my $exist   = MT::TemplateMap->exist(
         {
             blog_id      => $blog_id,
@@ -1133,5 +1133,5 @@
     );
     my $map = MT::TemplateMap->new;
-    $map->is_preferred( $count ? 0 : 1 );
+    $map->is_preferred( $exist ? 0 : 1 );
     $map->template_id( scalar $q->param('template_id') );
     $map->blog_id($blog_id);
@@ -1835,5 +1835,5 @@
         my $new_name = $new_basename;
         my $i = 0;
-        while (MT::Template->count({ name => $new_name, blog_id => $tmpl->blog_id })) {
+        while (MT::Template->exist({ name => $new_name, blog_id => $tmpl->blog_id })) {
             $new_name = $new_basename . ' (' . ++$i . ')';
         }
Index: branches/release-34/lib/MT/CMS/Tag.pm
===================================================================
--- branches/release-34/lib/MT/CMS/Tag.pm (revision 1823)
+++ branches/release-34/lib/MT/CMS/Tag.pm (revision 1873)
@@ -110,5 +110,5 @@
     if ( $tag && $blog_id ) {
         my $ot_class = $app->model('objecttag');
-        my $count    = $ot_class->count(
+        my $exist    = $ot_class->exist(
             {
                 object_datasource => $class->datasource,
@@ -117,5 +117,5 @@
             }
         );
-        undef $tag unless $count;
+        undef $tag unless $exist;
     }
     return $app->json_result( { exists => $tag ? 'true' : 'false' } );
Index: branches/release-34/lib/MT/CMS/Entry.pm
===================================================================
--- branches/release-34/lib/MT/CMS/Entry.pm (revision 1823)
+++ branches/release-34/lib/MT/CMS/Entry.pm (revision 1873)
@@ -81,5 +81,5 @@
             $param->{can_send_notifications} = 1;
             $param->{has_subscribers} =
-              $not_class->count( { blog_id => $blog_id } );
+              $not_class->exist( { blog_id => $blog_id } );
         }
 
@@ -1151,7 +1151,7 @@
             && $type eq 'entry' )
         {
-            my $cnt =
-              $class->count( { blog_id => $blog_id, basename => $basename } );
-            if ($cnt) {
+            my $exist =
+              $class->exist( { blog_id => $blog_id, basename => $basename } );
+            if ($exist) {
                 $obj->basename( MT::Util::make_unique_basename($obj) );
             }
Index: branches/release-34/lib/MT/ObjectDriver/Driver/DBI.pm
===================================================================
--- branches/release-34/lib/MT/ObjectDriver/Driver/DBI.pm (revision 1502)
+++ branches/release-34/lib/MT/ObjectDriver/Driver/DBI.pm (revision 1873)
@@ -59,4 +59,21 @@
                      order  => '',
                      limit  => undef,
+                     offset => undef,
+                    },
+    );
+}
+
+sub exist {
+    my $driver = shift;
+    my($class, $terms, $args) = @_;
+
+    return $driver->_select_aggregate(
+        select   => '1',
+        class    => $class,
+        terms    => $terms,
+        args     => $args,
+        override => {
+                     order  => '',
+                     limit  => 1,
                      offset => undef,
                     },
Index: branches/release-34/lib/MT/Tag.pm
===================================================================
--- branches/release-34/lib/MT/Tag.pm (revision 1657)
+++ branches/release-34/lib/MT/Tag.pm (revision 1873)
@@ -95,5 +95,5 @@
         if (!$tag->n8d_id) {
             # normalized tag! we can't delete if others reference us
-            my $child_tags = MT::Tag->count({n8d_id => $tag->id});
+            my $child_tags = MT::Tag->exist({n8d_id => $tag->id});
             return $tag->error(MT->translate("This tag is referenced by others."))
                 if $child_tags;
@@ -108,8 +108,8 @@
     if ($n8d_tag) {
         # Normalized tag, no longer referenced by other tags...
-        if (!MT::Tag->count({n8d_id => $n8d_tag->id})) {
+        if (!MT::Tag->exist({n8d_id => $n8d_tag->id})) {
             # Noramlized tag that no longer has any object tag associations
             require MT::ObjectTag;
-            if (!MT::ObjectTag->count({tag_id => $n8d_tag->id})) {
+            if (!MT::ObjectTag->exist({tag_id => $n8d_tag->id})) {
                 $n8d_tag->remove
                     or return $tag->error($n8d_tag->errstr);
@@ -412,5 +412,5 @@
         my $this_tag_id = $otag->tag_id;
         $otag->remove;
-        if (! MT::ObjectTag->count({tag_id => $this_tag_id})) {
+        if (! MT::ObjectTag->exist({tag_id => $this_tag_id})) {
             # no more references to this tag... just delete it now
             if (my $tag = MT::Tag->load($this_tag_id)) {
Index: branches/release-34/lib/MT/App.pm
===================================================================
--- branches/release-34/lib/MT/App.pm (revision 1823)
+++ branches/release-34/lib/MT/App.pm (revision 1873)
@@ -1649,5 +1649,5 @@
     }
 
-    my $existing = MT::Author->count( { name => $name } );
+    my $existing = MT::Author->exist( { name => $name } );
     return $app->error($app->translate("A user with the same name already exists."))
         if $existing;
Index: branches/release-34/lib/MT/AtomServer.pm
===================================================================
--- branches/release-34/lib/MT/AtomServer.pm (revision 1825)
+++ branches/release-34/lib/MT/AtomServer.pm (revision 1873)
@@ -342,5 +342,5 @@
     if (my $basename = $app->get_header('Slug')) {
         my $entry_class = ref $entry;
-        my $basename_uses = $entry_class->count({
+        my $basename_uses = $entry_class->exist({
             blog_id  => $entry->blog_id,
             basename => $basename,
Index: branches/release-34/lib/MT/BackupRestore/BackupFileHandler.pm
===================================================================
--- branches/release-34/lib/MT/BackupRestore/BackupFileHandler.pm (revision 1711)
+++ branches/release-34/lib/MT/BackupRestore/BackupFileHandler.pm (revision 1873)
@@ -256,5 +256,5 @@
             }
             elsif ('permission' eq $name) {
-                my $perm = $class->count( {
+                my $perm = $class->exist( {
                     author_id => $obj->author_id,
                     blog_id   => $obj->blog_id
Index: branches/release-34/lib/MT/Template/ContextHandlers.pm
===================================================================
--- branches/release-34/lib/MT/Template/ContextHandlers.pm (revision 1862)
+++ branches/release-34/lib/MT/Template/ContextHandlers.pm (revision 1873)
@@ -3043,5 +3043,5 @@
 
     my $class = MT->model('entry');
-    $class->count( \%terms );
+    $class->exist( \%terms );
 }
 
@@ -3058,5 +3058,5 @@
 
     my $class = MT->model('page');
-    $class->count( \%terms );
+    $class->exist( \%terms );
 }
 
Index: branches/release-34/lib/MT/App/Comments.pm
===================================================================
--- branches/release-34/lib/MT/App/Comments.pm (revision 1823)
+++ branches/release-34/lib/MT/App/Comments.pm (revision 1873)
@@ -680,5 +680,5 @@
 
     if (
-        MT::Comment->count(
+        MT::Comment->exist(
             {
                 ip         => $user_ip,
Index: branches/release-34/lib/MT/App/Trackback.pm
===================================================================
--- branches/release-34/lib/MT/App/Trackback.pm (revision 1866)
+++ branches/release-34/lib/MT/App/Trackback.pm (revision 1873)
@@ -560,5 +560,5 @@
     }
     elsif ( my $cid = $tb->category_id ) {
-        my $count = $app->model('entry')->count(
+        my $exist = $app->model('entry')->exist(
             { status => MT::Entry::RELEASE() },
             {
@@ -569,5 +569,5 @@
         return $app->_response(
             Error => $app->translate( "Invalid TrackBack ID '[_1]'", $tb_id ) )
-          if $count <= 0;
+          unless $exist;
     }
     my $rss = _generate_rss($tb);
Index: branches/release-34/lib/MT/Util.pm
===================================================================
--- branches/release-34/lib/MT/Util.pm (revision 1823)
+++ branches/release-34/lib/MT/Util.pm (revision 1873)
@@ -936,5 +936,5 @@
 
     my $class = ref $entry; 
-    while ($class->count({ blog_id => $blog->id,
+    while ($class->exist({ blog_id => $blog->id,
                            basename => $base })) {
         $base = $base_copy . '_' . $i++;
@@ -962,5 +962,5 @@
 
     my $cat_class = ref $cat;
-    while ($cat_class->count({ blog_id => $cat->blog_id,
+    while ($cat_class->exist({ blog_id => $cat->blog_id,
                                basename => $base })) {
         $base = $base_copy . '_' . $i++;
@@ -982,5 +982,5 @@
 
     my $author_class = ref $author;
-    while ($author_class->count({ basename => $base })) {
+    while ($author_class->exist({ basename => $base })) {
         $base = $base_copy . '_' . $i++;
     }
Index: branches/release-34/lib/MT/XMLRPCServer.pm
===================================================================
--- branches/release-34/lib/MT/XMLRPCServer.pm (revision 1823)
+++ branches/release-34/lib/MT/XMLRPCServer.pm (revision 1873)
@@ -184,5 +184,5 @@
         # Ensure this basename is unique.
         my $entry_class = ref $entry;
-        my $basename_uses = $entry_class->count({
+        my $basename_uses = $entry_class->exist({
             blog_id  => $entry->blog_id,
             basename => $basename,
