Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: fastest way to determine if 0 or more records are present in table?
flavio_at_tin.it (FC) wrote in
news:2bd78ddf.0402190536.53e702c2_at_posting.google.com:
> Chuck <chuckh_nospam_at_softhome.net> wrote in message
> news:<Xns94937D64E2FFchuckhsofthomenet_at_130.133.1.4>...
>> >> ... >> >> But you probably don't want to query the entire table of there are >> millions of rows. I'd use a simple query like this... >> >> select count(*) from mytable where rownum < 2; >> >> Returns 0 if no rows exist, or 1 if 1 or more rows exit.
The optimizer in 8.1.7 is noticably smarter than what was available 4 years ago. The 9i optimizer is supposed to be even better. Not sure about 10g as it's way to new for me to be comfortable with it. I prefer to give new versions at least a year before running any of my databases with them. We are just now starting the move to 9.2.
-- Chuck Remove "_nospam" to reply by emailReceived on Thu Feb 19 2004 - 07:50:41 CST
![]() |
![]() |