Database Query Optimization

There are several ways a database query can be executed.  Some are much more effecient than others.  To be concrete, consider a movie database with 100,000 movies listed, including 10,000 movies made after 1970.  Also consider a actors database with 10,000 actors/movie pairs, including 20 listings showing the twenty moves made by John Wayne.  I'll guess that there are 3,000 actors who have made movies since the seventies.  Finally, assume that John Wayne made 10 movies after 1970.

How does one execute this query?

select * from movies, actors where actor.name="John Wayne" and year > 1970 and actor.movie_title = movie.title
 

Strategy One

Total records handled.  100,000+10,000+1,000,000,000+2,000,000+200,000+10 = 1,002,310,010 records

Strategy Two

Total records handeled: 100,000 + 10,000 + 1,000,000,000 + 100,000 + 20 + 10 = 1,000,210,030 records

Strategy Three

Total records handled: 100,000 + 10,000 + 20 + 10,000 + 200,000 + 10 = 320,030

Strategy Four

This handles 100,000 + 10,000 + 3,000 + 10=113,010 records, including a scattered read of 3000 records.

Strategy Five

Total records handled: 10,000 + 20 + 10 including 20 scattered reads.