The tremendous progress in artificial intelligence promotes the wide application of machine learning (ML) technology in the field of electronic science. Recently ML-based antenna optimization provides a distinct candidate and attracts considerable attention. However, the large number of training samples generated through time-consuming EM simulations becomes a significant challenge. In this article, an efficient online data-driven enhanced-XGBoost (E-XGBoost) method for antenna optimization is proposed, which is mainly composed of two parts, i.e., an input variable filter module (IVFM) and an antenna optimization module (AOM). Specifically, IVFM serves as a variable sensitivity analyzer, which is accomplished by E-XGBoost to efficiently reduce the dimension of design variable and hence save the training samples. Next, the design variables obtained by IVFM are fed into AOM to find the near-optimal solution. In AOM, an online learning strategy is proposed to train a local E-XGBoost model to evaluate the population in the metaheuristic optimization algorithm (MOA). Compared to the global ML model that can mimic the entire design space, this local E-XGBoost model can further cut down the training samples. To verify the performance of the proposed method, several different antenna examples, i.e., U-slot patch antenna, Fabry-Perot resonant antenna, and dual-polarized cross dipole antenna and 5G MIMO antenna array, are simulated. Numerical results support the proposed method in terms of its superior performance and potential advantage of saving computational overhead.