List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 19 1999 10:27am
Subject:Fast way to determine if a table exists ... using the C API
View as plain text  
>>>>> "Vasanthan" == Vasanthan Gunaratnam <vasg@stripped>
> writes:

Vasanthan> I am trying to use the C API to determine if a table exists in the
Vasanthan> database and I know of two ways to do this:
Vasanthan>     1) Use mysql_list_tables() and then go through the list of tables to
Vasanthan> determine if the table exists.
Vasanthan>     or
Vasanthan>     2) Use the SQL statement 'SHOW TALBES LIKE "tableName"' and check if
Vasanthan> the result has a match.

Vasanthan> Unfortunately, both ways are relatively slow. I would appreciate it if
Vasanthan> someone could tell me of a faster way to accoplish the above.

Vasanthan> Thanks in advance,

Hi!

SELECT count(*) from tablename is fast!

Regards,
Monty
Thread
Blobs Binaries Argh!!!Abram Hindle)14 Aug
  • Blobs Binaries Argh!!!sinisa14 Aug
  • Re: Blobs Binaries Argh!!!Martin Ramsch14 Aug
  • Fast way to determine if a table exists ... using the C APIVasanthan Gunaratnam17 Sep
    • Fast way to determine if a table exists ... using the C APIMichael Widenius19 Sep
  • Re: Fast way to determine if a table exists ... using the C APICary Collett17 Sep
  • C API include files ?Vasanthan Gunaratnam29 Sep
    • Re: C API include files ?sinisa30 Sep
      • Re: C API include files ?bpaduraru30 Sep