Why would (select * from foo) take up lost of resources? Won't it just
place the cursor at the first row and only return when rows are fetched?
Ilya Sterin
-----Original Message-----
From: Mike Schienle [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 25, 2001 9:43 PM
To: '[EMAIL PROTECTED]'
Subject: Re: Easiest way to tell if a table already exists?
On Wednesday, April 25, 2001, at 06:09 PM, Neil Lunn wrote:
>> -----Original Message-----
>> From: Thomas von Elling Skifter Eibner [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, April 25, 2001 7:27 AM
>> To: Mark Riehl
>>>
>>> The New Riders MySQL book has the following statements:
>>> SELECT COUNT(*) FROM table_name
>>> SELECT * FROM table_name WHERE 1=0
>>>
>> SELECT 1 FROM table_name (just another variant of yours).
> select * from table_name
These last two certainly work, but they can be pretty wasteful
of resources. The two mentioned in the New Riders MySQL book
both return a single row indicating success or failure. The last
two return a row for each record in the table. You'd probably be
less than thrilled if you have a few million records.
Mike Schienle
Interactive Visuals, Inc.
http://www.ivsoftware.com