In theory, that would be ideal if your goal is solely getting the transaction to mine.
Hurts permissionless mining However it does require knowing how to reach miners directly. Mining is designed to be a permissionless business, accessible for anyone with the right hardware. Your solution would require publishing the IP addresses of miners to all transaction creators.
Hurts sender privacy It would also hurt privacy, as miners would learn the sender IP of transaction creators; possibly enabling them to censor based on that information.
Not relaying transactions doesn't gain you much The marginal cost of relaying every transaction to every node is low since the introduction of algorithms like BIP152 (compact blocks). Assuming a transaction will eventually be mined anyway, that transaction needs to reach every full node eventually (as part of a block). Relaying it as a separate transaction ahead of time doesn't cost anything, if the relay of the block can refer to the earlier transaction instead. There are some costs related to 'inv' messages that can be reduced though, without removing transaction relay.
Hurts block propagation speed And lastly, only broadcasting transaction to miners directly would worsen block propagation speed very significantly. Modern block relay protocols (like BIP152 and FIBRE) rely on nodes knowing the bulk of blocks' transaction ahead of time to quickly relay those blocks.
1Good answer. You might want to mention that full nodes can opt out of relaying unconfirmed transactions by running in blocks-only mode. – Murch – 2018-12-19T21:24:25.910
Thanks for the reply. I was looking into this solution in order to somehow reduce the 'waste' that currently happens when transactions are being relayed across the network as nodes currently will receive many INV for a transaction that they already have. In this proposed solution, non-mining nodes will only receive transactions once they are in the mined block and hence no duplication of tx INV – Herofire – 2018-12-19T21:32:58.233
2@Herofire I'm actually working myself on a solution to that redundancy, using set reconciliation algorithms to find differences between known invs instead of just broadcasting them all. – Pieter Wuille – 2018-12-19T22:01:47.927