title: Oracle: speeding up count(*)?
body: <p>I've got an application being put together with cake/php.  It's
  pretty nice, but their data pager does this:</p>
  
  <pre><code>SELECT COUNT(*) AS COUNT
  FROM foo f
  LEFT JOIN bar b 
  ON (f.asset_group_id = b.asset_group_id)
  WHERE 1                    = 1
  </code></pre>
  
  <p>Any way possible to speed this up?</p>
  
  <p><strong>update:</strong> table definitions (extra columns removed):</p>
  
  <pre><code>create table bar (
        last_modified_by varchar2(16), 
        asset_group_id number(10,0) not null enable, 
        folder varchar2(512) not null enable, 
        name varchar2(512) not null enable, 
        kind varchar2(16),
        -- exta fields deleted
         constraint bar_pk primary key (folder, name) enable
   );
  
  create index bar_last_modified_date on bar (last_modified_date desc) ;
  create index bar_asset_group_id on bar (asset_group_id desc) ;
  create index bar_folder on bar (folder) ;
  create index bar_kind on bar (kind) ;
  create unique index bar_pk on bar (folder, name) ;
  
  create table foo (
        created_date date not null enable, 
        asset_group_id number(10,0) not null enable, 
        keyword varchar2(4000) not null enable, 
        -- exta fields deleted
        constraint foo_pk primary key (asset_group_id, keyword) enable
  )  enable row movement ;
  
  create index foo_created on foo (created_date desc) ;
  create unique index foo_pk on foo (asset_group_id, keyword) ;
  </code></pre>