Subject | RE: [firebird-support] Count(*) on big tables |
---|---|
Author | Svend Meyland Nicolaisen |
Post date | 2004-05-06T07:57:43Z |
But then the count will become incorrect if you rollback an insert wouldn't
it?
-
SMN
it?
-
SMN
> -----Original Message-----
> From: Nigel Weeks [mailto:nweeks@...]
> Sent: 6. maj 2004 01:30
> To: firebird-support@yahoogroups.com
> Subject: RE: [firebird-support] Count(*) on big tables
>
> Or, if you don't need an exact number of records, but just a
> count of records inserted, create a generator for the
> purpose, increment it with a trigger, but don't store the
> value anywhere!
>
> Then, to get the count, do:
> select gen_id(tablecountergenerator,0) from rdb$database;
>
> Very quick indeed!
>
> N.
>
> > -----Original Message-----
> > From: Hans Hoogstraat [mailto:hans@...]
> > Sent: Thursday, 6 May 2004 9:59 AM
> > To: firebird-support@yahoogroups.com
> > Subject: Re: [firebird-support] Count(*) on big tables
> >
> >
> > It is much faster to maintain an additional 'counts' table,
> updated by
> > the 'after insert' and 'after delete'
> > triggers for tables or conditions you want to count or
> estimate in a
> > multi-user environment.
> >
> > -------------------------------------------------
> > ----- Original Message -----
> > From: "Jerome Bouvattier" <JBouvattier@...>
> > To: <firebird-support@yahoogroups.com>
> > Sent: Wednesday, May 05, 2004 8:44 AM
> > Subject: [firebird-support] Count(*) on big tables
> >
> >
> > | Hello,
> > |
> > | I know Count(*) requires a full scan and can't return
> > immedialtely. But
> > | isn't 8 minutes a bit too much for a 50 millions rows table ?
> > |
> > | The first time, I thought it was due to GC, but subsequent
> > calls took as
> > | long.
> > |
> > | Any hint ?
> > |
> > | Thanks.
> > |
> > | --
> > | Jerome
> > |
> > |
> > |
> > |
> > |
> > | Yahoo! Groups Links
> > |
> > |
> > |
> > |
> >
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
> > ---------------------~--> Make a clean sweep of pop-up ads. Yahoo!
> > Companion Toolbar.
> > Now with Pop-Up Blocker. Get it for free!
> > http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/67folB/TM
> > --------------------------------------------------------------
> > -------~->
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>