I haven't seen anything on this thread related to DBI (but have
seen at least some misinformation about Oracle). Does
anyone know of some kind of 'any-db' sql list where this
would be appropriate? If so, I'd be happy to add my 2 cents
there.
-Chris
> -----Original Message-----
> From: Michael Peppler [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 1:48 PM
> To: Tim Harsch
>
> Tim Harsch writes:
> >
> >
> > Don't think so, the database would clearly have to
> visit every row in order
> > to know there are none that match.
>
> Wrong... at least for Sybase.
>
> In a table with 4 million rows, doing a check on an indexed column:
>
> select 1 from eC_user where exists (select * from eC_user
> where userId = 999999999)
>
> Table: eC_user scan count 0, logical reads: (regular=0
> apf=0 total=0),
> physical reads: (regular=0 apf=0 total=0), apf IOs used=0
> Table: eC_user scan count 1, logical reads: (regular=3
> apf=0 total=3),
> physical reads: (regular=0 apf=0 total=0), apf IOs used=0
> Total writes for this command: 0
>
> In this case it only needs to do 3 IO operations to find that no rows
> match...
>