I have been writing a some plugin for which I need to fetch the
term_taxonomy_id from the
term_taxonomy table of WordPress for the provided term name.
Though I tried to benchmark them but in best and worst case, but due to not much data in the database, both of them almost equal time.
The queries I am concerned about are...
SELECT `term_taxonomy_id` FROM ` wp_term_taxonomy` WHERE `term_id` = ( SELECT `term_id` FROM wp_terms WHERE name = 'jrf' )
SELECT a.term_id, b.term_taxonomy_id FROM wp_terms a INNER JOIN wp_term_taxonomy b ON a.name = 'jrf' AND a.term_id = b.term_id