Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: using constants
Hello,
> To your first question, as others have said, it is not likely to make
> a difference. If the word defines a well known state, and the name
> will never change, it is just fine. A lookup table may be nice, but
> that depends on the way it is used.
would you say the same is true for joins? What would be faster,
this one?
domains
records
for a query like
select * from domains d, records r where d.name = r.name and d.name = 'whatever'
or this one:
domains
records
for a query like
select * from domains d, records r where d.id = r.domain_id and d.name = 'whatever'
Mathematically it should be faster to compare two 4 byte non-zero integer values than two at least 8 byte strings. But the first solution is more elegant and intuitive.
Regards
Marten
Received on Thu Nov 29 2007 - 16:19:08 CST
![]() |
![]() |