improved the mysql query for host updating for the first time
improved the mysql query for host updating for the first time