Re: SQLPLUS window freezes

From: default <abuse_at_hotmail.com>
Date: 2000/06/27
Message-ID: <3958559D.3069A492_at_hotmail.com>#1/1


Matt Foster wrote:
>
> Saugato Mukerji wrote:
> >
> > Hi
> >
> > a big query like
> >
> > select count(*) from bigTable;
> >
> > -- freezes the SQLPLUS window on NT . The table bigTable has 20 million
> > rows.
> > -- is there a way to abort the query other than killing the SQLPLUS window
> > -- from taskmanager.
> >
> > thanks
> >
> > Saugato
>
> I seem to remember reading in a book somewhere that if you've got a big
> table, you can cut down the time of a count by select count(1) from
> tablename. I seem to remember the idea was that by asking it to return a
> 1, rather than *, you were cutting down on the buffer space needed. Can
> anyone confirm, whether select count(*) actually counts the entire row,
> or whether it returns a * for each row and counts?
>
> MF

[Quoted] As far as i know, count(*) first checks that not all columns (*) are null, whereas (1) can never be null.

Frank Received on Tue Jun 27 2000 - 00:00:00 CEST

Original text of this message