On Mon, 30 Oct 2006, Igor Tandetnik wrote:

> Date: Mon, 30 Oct 2006 11:21:15 -0500
> From: Igor Tandetnik <[EMAIL PROTECTED]>
> Reply-To: sqlite-users@sqlite.org
> To: SQLite <sqlite-users@sqlite.org>
> Subject: [sqlite] Re: efficient way to figure out if a table is empty
>
> Xavier Noria <[EMAIL PROTECTED]> wrote:
> > Not that is critical for my application, but just for curiosity which
> > is the recommended idiom to figure out whether a table has any
> > register?
>
> select exists (select * from tablename);
>
> Igor Tandetnik

Would it not make sense to use the limit on the subquery to reduce
overhead in the case where the table is populated?

        select exists( select * from tablename limit 1 );



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to