SELECT count(*) FROM actor a JOIN film_actor fa USING (actor_id) WHERE a.last_name = 'WAHLBERG'
执行计划
SELECT EXISTS ( SELECT * FROM actor a JOIN film_actor fa USING (actor_id) WHERE a.last_name = 'WAHLBERG' )
参考博文: https://blog.jooq.org/2016/09/14/avoid-using-count-in-sql-when-you-could-use-exists/?blogsub=confirming#subscribe-blog