I have to do a query for a Oracle database to verify if there are at least one record that match my query. 

There are 6 joins in the tables and the main table have about 40 million records. 

I try two ways to do the select: 

```
select 1 from Table t ... 
    join X on x.id = T.id join Y on y.id = x.id ....
    where x.field = ? and y.field = ? and t.field = ?
    and rownum = 1

```

and 

```
select count (*) from Table t ... 
    join X on x.id = T.id join Y on y.id = x.id ....
where 
    x.field = ? and y.field = ? and t.field = ?
    and rownum = 1

```

I don't have experience with Databses querys at all, in preliminars tests I get betters queries times in the first case, but when there is no records the first query seems to be very slow. But I don't know even if i'm doing the benchmark in the correctly. 

So I ask, what is the best way to do this type of queries?