{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,11,24]],"date-time":"2025-11-24T15:35:07Z","timestamp":1763998507271,"version":"3.45.0"},"reference-count":50,"publisher":"MDPI AG","issue":"12","license":[{"start":{"date-parts":[[2025,11,23]],"date-time":"2025-11-23T00:00:00Z","timestamp":1763856000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100007694","name":"Ministry of Land, Infrastructure and Transport","doi-asserted-by":"publisher","award":["RS-2022-00143336"],"award-info":[{"award-number":["RS-2022-00143336"]}],"id":[{"id":"10.13039\/501100007694","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["IJGI"],"abstract":"<jats:p>The rapid adoption of GPS-enabled mobile devices has produced massive trajectory datasets that drive modern applications in traffic prediction, logistics, and spatio-temporal analytics. Yet traditional database management systems (DBMSs) still lack native operators to process such data efficiently. To overcome this limitation, we introduce a set of k-nearest neighbor (k-NN) user-defined aggregates (UDAs) that embed k-NN processing directly within the PostgreSQL engine. By integrating computation into the database core, our approach minimizes data transfer and latency while maintaining low storage overhead. Experiments on benchmarked BerlinMOD-derived datasets demonstrate that the proposed UDAs reduce query execution time by 6\u201323%, depending on dataset size and query complexity.<\/jats:p>","DOI":"10.3390\/ijgi14120458","type":"journal-article","created":{"date-parts":[[2025,11,24]],"date-time":"2025-11-24T13:09:25Z","timestamp":1763989765000},"page":"458","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":0,"title":["Efficient k-NN Trajectory Queries on Mobility Databases"],"prefix":"10.3390","volume":"14","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-7603-8465","authenticated-orcid":false,"given":"Linghui","family":"Lou","sequence":"first","affiliation":[{"name":"Department of Computer and Information Engineering, Kunsan National University, Gunsan 54150, Republic of Korea"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-4095-1196","authenticated-orcid":false,"given":"Dong June","family":"Lew","sequence":"additional","affiliation":[{"name":"Department of Computer and Information Engineering, Kunsan National University, Gunsan 54150, Republic of Korea"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-9970-7863","authenticated-orcid":false,"given":"Kwang Woo","family":"Nam","sequence":"additional","affiliation":[{"name":"Department of Computer and Information Engineering, Kunsan National University, Gunsan 54150, Republic of Korea"}]}],"member":"1968","published-online":{"date-parts":[[2025,11,23]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/2743025","article-title":"Trajectory data mining: An overview","volume":"6","author":"Zheng","year":"2015","journal-title":"Acm Trans. Intell. Syst. Technol. TIST"},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"53","DOI":"10.1007\/s41324-019-00269-x","article-title":"A survey on trajectory data warehouse","volume":"28","author":"Alsahfi","year":"2020","journal-title":"Spat. Inf. Res."},{"key":"ref_3","unstructured":"G\u00fcting, R.H., and Schneider, M. (2005). Moving Objects Databases, Elsevier."},{"key":"ref_4","doi-asserted-by":"crossref","unstructured":"Nam, K.W., Lee, J.H., Lee, S.H., Lee, J.W., and Park, J.H. (2004, January 14\u201317). Developing a main memory moving objects DBMS for high-performance location-based services. Proceedings of the Asia-Pacific Web Conference, Hangzhou, China.","DOI":"10.1007\/978-3-540-24655-8_94"},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"83489","DOI":"10.1109\/ACCESS.2022.3197169","article-title":"RealROI: Discovering Real Regions of Interest From Geotagged Photos","volume":"10","author":"Nam","year":"2022","journal-title":"IEEE Access"},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"102692","DOI":"10.1016\/j.jnca.2020.102692","article-title":"MARIO: A spatio-temporal data mining framework on Google Cloud to explore mobility dynamics from taxi trajectories","volume":"164","author":"Ghosh","year":"2020","journal-title":"J. Netw. Comput. Appl."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"491","DOI":"10.1007\/s41324-017-0115-5","article-title":"A method for similarity measurement in spatial trajectories","volume":"25","author":"Shaeri","year":"2017","journal-title":"Spat. Inf. Res."},{"key":"ref_8","doi-asserted-by":"crossref","unstructured":"Jae, L.E., Ryu, K.H., and Nam, K.W. (2004, January 14\u201317). Indexing for efficient managing current and past trajectory of moving object. Proceedings of the Asia-Pacific Web Conference, Hangzhou, China.","DOI":"10.1007\/978-3-540-24655-8_85"},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"144972","DOI":"10.1109\/ACCESS.2019.2945205","article-title":"A generalized approach for anomaly detection from the Internet of moving things","volume":"7","author":"Tian","year":"2019","journal-title":"IEEE Access"},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"104271","DOI":"10.1016\/j.jnca.2025.104271","article-title":"A proactive privacy-preserving framework for mobile trajectory sharing","volume":"242","author":"Farahnakiyan","year":"2025","journal-title":"J. Netw. Comput. Appl."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"108","DOI":"10.1016\/j.jnca.2018.02.002","article-title":"Location and trajectory privacy preservation in 5G-Enabled vehicle social network services","volume":"110","author":"Liao","year":"2018","journal-title":"J. Netw. Comput. Appl."},{"key":"ref_12","unstructured":"Hellerstein, J.M., Naughton, J.F., and Pfeffer, A. (1995, January 11\u201315). Generalized search trees for database systems. Proceedings of the 21st International Conference on Very Large Data Bases (VLDB\u201995), Zurich, Switzerland."},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"687","DOI":"10.1007\/s00778-010-0185-7","article-title":"Efficient k-nearest neighbor search on moving object trajectories","volume":"19","author":"Behr","year":"2010","journal-title":"VLDB J."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Cohen, S. (2006, January 27\u201329). User-defined aggregate functions: Bridging theory and practice. Proceedings of the 2006 ACM SIGMOD International Conference on Management of Data, Chicago, IL, USA.","DOI":"10.1145\/1142473.1142480"},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3406534","article-title":"MobilityDB: A mobility database based on PostgreSQL and PostGIS","volume":"45","author":"Sakr","year":"2020","journal-title":"ACM Trans. Database Syst. TODS"},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"85","DOI":"10.3745\/KTSDE.2017.6.2.85","article-title":"Design of Moving Object Query Processing Based on UDF","volume":"6","author":"Yoo","year":"2017","journal-title":"KIPS Trans. Softw. Data Eng."},{"key":"ref_17","unstructured":"Lou, L., and Nam, K.W. (2025, November 20). GitHub-Awarematics\/UrbanSQL\u2014github.com. Available online: https:\/\/github.com\/awarematics\/UrbanSQL."},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"3910","DOI":"10.14778\/3611540.3611583","article-title":"DeepVQL: Deep Video Queries on PostgreSQL","volume":"16","author":"Lew","year":"2023","journal-title":"Proc. VLDB Endow."},{"key":"ref_19","unstructured":"Group, P.G.D. (2025, November 20). PostgreSQL\u2014postgresql.org. Available online: https:\/\/postgresql.org."},{"key":"ref_20","unstructured":"Feng, R. (2025, November 20). \u201cKNN Ultimate Optimization: From RDS to PostGIS\u201d. Available online: https:\/\/vonng.com\/en\/pg\/knn-optimize\/."},{"key":"ref_21","unstructured":"Korotkov, A. (2025, November 20). GitHub-postgrespro\/imgsmlr: Similar Images Search for PostgreSQL\u2014github.com. Available online: https:\/\/github.com\/postgrespro\/imgsmlr."},{"key":"ref_22","unstructured":"PostgreSQL (2025, November 20). F.9. Cube\u2014Postgresql.org. Available online: https:\/\/www.postgresql.org\/docs\/current\/cube.html."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"G\u00fcnther, M. (2018, January 10\u201315). Freddy: Fast word embeddings in database systems. Proceedings of the 2018 International Conference on Management of Data (SIGMOD\u201918), Houston, TX, USA.","DOI":"10.1145\/3183713.3183717"},{"key":"ref_24","doi-asserted-by":"crossref","unstructured":"Yang, W., Li, T., Fang, G., and Wei, H. (2020, January 14\u201319). PASE: PostgreSQL Ultra-High-Dimensional Approximate Nearest Neighbor Search Extension. Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, Portland, OR, USA.","DOI":"10.1145\/3318464.3386131"},{"key":"ref_25","doi-asserted-by":"crossref","unstructured":"Eltabakh, M.Y., Eltarras, R., and Aref, W.G. (2006, January 3\u20137). Space-partitioning trees in PostgreSQL: Realization and performance. Proceedings of the 22nd International Conference on Data Engineering (ICDE\u201906), Atlanta, GA, USA.","DOI":"10.1109\/ICDE.2006.146"},{"key":"ref_26","doi-asserted-by":"crossref","unstructured":"Donk\u00f3, I., Szalai-Gindl, J.M., Gombos, G., and Kiss, A. (2019, January 20\u201322). An implementation of the M-tree index structure for PostgreSQL using GiST. Proceedings of the 2019 IEEE 15th International Scientific Conference on Informatics, Poprad, Slovakia.","DOI":"10.1109\/Informatics47936.2019.9119265"},{"key":"ref_27","unstructured":"Ciaccia, P., Patella, M., and Zezula, P. (1997, January 25\u201329). M-tree: An efficient access method for similarity search in metric spaces. Proceedings of the 23rd International Conference on Very Large Data Bases (VLDB\u201997), Athens, Greece."},{"key":"ref_28","doi-asserted-by":"crossref","first-page":"551","DOI":"10.1007\/s41324-018-0198-7","article-title":"An efficient hybridized index technique for moving object database","volume":"26","author":"Rslan","year":"2018","journal-title":"Spat. Inf. Res."},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"565","DOI":"10.1007\/s41324-019-00256-2","article-title":"Improving the performance of location based spatial textual query processing using distributed strip index","volume":"27","author":"Priya","year":"2019","journal-title":"Spat. Inf. Res."},{"key":"ref_30","unstructured":"Pgvector developers (2025, November 20). GitHub-Pgvector\/Pgvector\u2014github.com. Available online: https:\/\/github.com\/pgvector\/pgvector."},{"key":"ref_31","doi-asserted-by":"crossref","unstructured":"Roussopoulos, N., Kelley, S., and Vincent, F. (1995, January 22\u201325). Nearest neighbor queries. Proceedings of the 1995 ACM SIGMOD International Conference on Management of Data, San Jose, CA, USA.","DOI":"10.1145\/223784.223794"},{"key":"ref_32","doi-asserted-by":"crossref","first-page":"16","DOI":"10.1145\/290593.290596","article-title":"Enhanced nearest neighbour search on the R-tree","volume":"27","author":"Cheung","year":"1998","journal-title":"ACM Sigmod Rec."},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"159","DOI":"10.1007\/s10707-006-0007-7","article-title":"Algorithms for nearest neighbor search on moving object trajectories","volume":"11","author":"Frentzos","year":"2007","journal-title":"Geoinformatica"},{"key":"ref_34","doi-asserted-by":"crossref","first-page":"265","DOI":"10.1145\/320248.320255","article-title":"Distance browsing in spatial databases","volume":"24","author":"Hjaltason","year":"1999","journal-title":"ACM Trans. Database Syst. TODS"},{"key":"ref_35","doi-asserted-by":"crossref","unstructured":"Song, Z., and Roussopoulos, N. (2001, January 12\u201315). K-nearest neighbor search for moving query point. Proceedings of the International Symposium on Spatial and Temporal Databases, Redondo Beach, CA, USA.","DOI":"10.1007\/3-540-47724-1_5"},{"key":"ref_36","doi-asserted-by":"crossref","unstructured":"Tao, Y., Papadias, D., and Shen, Q. (2002, January 20\u201323). Continuous nearest neighbor search. Proceedings of the VLDB\u201902: Proceedings of the 28th International Conference on Very Large Databases, Hong Kong, China.","DOI":"10.1016\/B978-155860869-6\/50033-0"},{"key":"ref_37","doi-asserted-by":"crossref","unstructured":"Frentzos, E., Pelekis, N., Ntoutsi, I., and Theodoridis, Y. (2008). Trajectory database systems. Mobility, Data Mining and Privacy, Springer.","DOI":"10.1007\/978-3-540-75177-9_7"},{"key":"ref_38","doi-asserted-by":"crossref","unstructured":"Ferhatosmanoglu, H., Stanoi, I., Agrawal, D., and El Abbadi, A. (2001, January 12\u201315). Constrained nearest neighbor queries. Proceedings of the International Symposium on Spatial and Temporal Databases, Redondo Beach, CA, USA.","DOI":"10.1007\/3-540-47724-1_14"},{"key":"ref_39","unstructured":"Papadias, D., Shen, Q., Tao, Y., and Mouratidis, K. (2004, January 2). Group nearest neighbor queries. Proceedings of the 20th International Conference on Data Engineering, Boston, MA, USA."},{"key":"ref_40","unstructured":"Deng, K., Shen, H.T., Xu, K., and Lin, X. (2006, January 3\u20138). Surface k-NN query processing. Proceedings of the 22nd International Conference on Data Engineering (ICDE\u201906), Atlanta, GA, USA."},{"key":"ref_41","doi-asserted-by":"crossref","first-page":"201","DOI":"10.1145\/335191.335415","article-title":"Influence sets based on reverse nearest neighbor queries","volume":"29","author":"Korn","year":"2000","journal-title":"ACM Sigmod Rec."},{"key":"ref_42","unstructured":"Zhang, J., Mamoulis, N., Papadias, D., and Tao, Y. (2004, January 21\u201323). All-nearest-neighbors queries in spatial databases. Proceedings of the 16th International Conference on Scientific and Statistical Database Management, Santorini Island, Greece."},{"key":"ref_43","doi-asserted-by":"crossref","unstructured":"Chang, Y., Tanin, E., Cong, G., Jensen, C.S., and Qi, J. (2023). Trajectory similarity measurement: An efficiency perspective. arXiv.","DOI":"10.14778\/3665844.3665858"},{"key":"ref_44","doi-asserted-by":"crossref","first-page":"e70085","DOI":"10.1111\/tgis.70085","article-title":"Activity Semantics Embedding-Based Trajectory Similarity Computation","volume":"29","author":"Fan","year":"2025","journal-title":"Trans. GIS"},{"key":"ref_45","doi-asserted-by":"crossref","unstructured":"Luo, S., Zeng, W., and Sun, B. (2023). Contrastive learning for graph-based vessel trajectory similarity computation. J. Mar. Sci. Eng., 11.","DOI":"10.3390\/jmse11091840"},{"key":"ref_46","doi-asserted-by":"crossref","unstructured":"Bakalov, P., Hadjieleftheriou, M., Keogh, E.J., and Tsotras, V.J. (2005, January 9\u201313). Efficient Trajectory Joins Using Symbolic Representations. Proceedings of the IEEE International Conference on Mobile Data Management (MDM), Ayia Napa, Cyprus.","DOI":"10.1145\/1071246.1071259"},{"key":"ref_47","doi-asserted-by":"crossref","unstructured":"Arumugam, S., and Jermaine, C. (2006, January 3\u20138). Closest-Point-of-Approach Join for Moving Object Histories. Proceedings of the 22nd IEEE International Conference on Data Engineering (ICDE), Atlanta, GA, USA.","DOI":"10.1109\/ICDE.2006.36"},{"key":"ref_48","unstructured":"Aboulnaga, A., and Naughton, J.F. (March, January 28). Accurate estimation of the cost of spatial selections. Proceedings of the 16th International Conference on Data Engineering (Cat. No. 00CB37073), San Diego, CA, USA."},{"key":"ref_49","doi-asserted-by":"crossref","first-page":"170","DOI":"10.1007\/s00778-004-0142-4","article-title":"Optimizing spatial min\/max aggregations","volume":"14","author":"Zhang","year":"2005","journal-title":"VLDB J."},{"key":"ref_50","doi-asserted-by":"crossref","first-page":"1335","DOI":"10.1007\/s00778-009-0142-5","article-title":"BerlinMOD: A benchmark for moving object databases","volume":"18","author":"Behr","year":"2009","journal-title":"VLDB J."}],"container-title":["ISPRS International Journal of Geo-Information"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2220-9964\/14\/12\/458\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,11,24]],"date-time":"2025-11-24T15:27:18Z","timestamp":1763998038000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2220-9964\/14\/12\/458"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,11,23]]},"references-count":50,"journal-issue":{"issue":"12","published-online":{"date-parts":[[2025,12]]}},"alternative-id":["ijgi14120458"],"URL":"https:\/\/doi.org\/10.3390\/ijgi14120458","relation":{},"ISSN":["2220-9964"],"issn-type":[{"type":"electronic","value":"2220-9964"}],"subject":[],"published":{"date-parts":[[2025,11,23]]}}}