Does a safety wire prevent a fuel filter to detach during flight?
Safety wire is almost never "efficient", but efficiency is not the goal: Safety is.
You want to be certain that once the fuel strainer has been secured it's not going to fall off in flight (which will result in the engine being starved of fuel).  

On many light aircraft that's accomplished by wrapping safety wire on the fuel strainer to ensure it can't come loose in flight:


A skilled mechanic who works with safety wire every day can safety a fuel strainer in about a minute - probably even faster. It's pretty impressive to watch.  

A bungling incompetent like me who does it maybe once a year takes about 5 minutes, often punctuated with "colorful metaphors" and comments about the questionable parentage of the engineer responsible for the fuel strainer.

Either way, in the grand scheme of things that's not a lot of time spent on securing a flight-critical component.



Because there are far more bungling incompetents than skilled mechanics (and because even good mechanics are frequently not fond of safety wire) there are other fuel strainer designs which don't use safety wire.
The one I linked to uses a bayonet lock for the bowl, and a cotter pin to keep it from coming loose in flight. Anyone can bend a cotter pin in a couple of seconds, and as effective as the safety wire technique, if not moreso.