Subject | Re: getting table/view information |
---|---|
Author | Adam |
Post date | 2005-07-20T12:35:05Z |
> I had the idea to attach 1=2 to the users query, as in:Not really an answer to your question (because it already has been
>
> select xxx
> from tableX
> where 1=2
>
answered), but rather a warning.
Firebird 1.5 does not optimise this query particularly well. It will
do a table scan and for each record evaluate whether 1=2.
Our PK fields are defined as a domain Integer (check > 0), so when we
need to ensure 0 records are returned, we use the following syntax.
select xxx
from tableX
where ID < 0
Firebird can then use the PK index with very little penalty. But if
you are just interested in the field names you can query them directly.
Adam