Inefficient/bad solution for task required by boss/seniors - what to do?
If you see in your job that a solution required from you is inefficient and will likely cause problems in the future. You have been in that particular company only for a few months.

For example: you load numerous main objects (e.g. Blogs) from a database which require numerous sub-entities (e.g. BlogEntries, Comments etc.) for each of them, and the "bad" solution traverses all the main objects, sending a query for all their sub-entities, instead of loading them all in a single query.

You pointed out to the problem, but your boss and senior programmers don't want you to implement the "good" solution, because it would take time, the "bad" one doesn't make problems in the small test environment and they consider it to be gold-plating.

What will you do then? Implement and deliver the bad solution, get sure for yourself that you have written emails about the problem, so they don't blame you when the problems come. Or fight, if neccessary, until they kick you from the job, and refuse to deliver the bad solution anyway?
Inefficient/bad solution for task required by boss/seniors - what to do?
===

If you see in your job that a solution required from you is inefficient and will likely cause problems in the future. You have been in that particular company only for a few months.

For example: you load numerous main objects (e.g. Blogs) from a database which require numerous sub-entities (e.g. BlogEntries, Comments etc.) for each of them, and the "bad" solution traverses all the main objects, sending a query for all their sub-entities, instead of loading them all in a single query.

You pointed out to the problem, but your boss and senior programmers don't want you to implement the "good" solution, because it would take time, the "bad" one doesn't make problems in the small test environment and they consider it to be gold-plating.

What will you do then? Implement and deliver the bad solution, get sure for yourself that you have written emails about the problem, so they don't blame you when the problems come. Or fight, if neccessary, until they kick you from the job, and refuse to deliver the bad solution anyway?