A GPU-Based Implementation for Range Queries on Spaghettis Data Structure

  • Roberto Uribe-Paredes
  • Pedro Valero-Lara
  • Enrique Arias
  • José L. Sánchez
  • Diego Cazorla
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6782)


Similarity search in a large collection of stored objects in a metric database has become a most interesting problem. The Spaghettis is an efficient metric data structure to index metric spaces. However, for real applications processing large volumes of generated data, query response times can be high enough. In these cases, it is necessary to apply mechanisms in order to significantly reduce the average query time. In this sense, the parallelization of metric structures is an interesting field of research. The recent appearance of GPUs for general purpose computing platforms offers powerful parallel processing capabilities. In this paper we propose a GPU-based implementation for Spaghettis metric structure. Firstly, we have adapted Spaghettis structure to GPU-based platform. Afterwards, we have compared both sequential and GPU-based implementation to analyse the performance, showing significant improvements in terms of time reduction, obtaining values of speed-up close to 10.


Databases similarity search metric spaces algorithms data structures parallel processing GPU CUDA 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Chávez, E., Navarro, G., Baeza-Yates, R., Marroquín, J.L.: Searching in metric spaces. ACM Computing Surveys 33(3), 273–321 (2001)CrossRefGoogle Scholar
  2. 2.
    Kalantari, I., McDonald, G.: A data structure and an algorithm for the nearest point problem. IEEE Transactions on Software Engineering 9(5) (1983)Google Scholar
  3. 3.
    Uhlmann, J.: Satisfying general proximity/similarity queries with metric trees. Information Processing Letters 40, 175–179 (1991)CrossRefzbMATHGoogle Scholar
  4. 4.
    Ciaccia, P., Patella, M., Zezula, P.: M-tree: An efficient access method for similarity search in metric spaces. In: The 23st International Conference on VLDB, pp. 426–435 (1997)Google Scholar
  5. 5.
    Brin, S.: Near neighbor search in large metric spaces. In: The 21st VLDB Conference, pp. 574–584. Morgan Kaufmann Publishers, San Francisco (1995)Google Scholar
  6. 6.
    Uribe, R., Navarro, G.: Egnat: A fully dynamic metric access method for secondary memory. In: Proc. 2nd International Workshop on Similarity Search and Applications (SISAP), pp. 57–64. IEEE CS Press, Los Alamitos (2009)Google Scholar
  7. 7.
    Navarro, G.: Searching in metric spaces by spatial approximation. The Very Large Databases Journal (VLDBJ) 11(1), 28–46 (2002)CrossRefGoogle Scholar
  8. 8.
    Gropp, W., Lusk, E., Skelljum, A.: Using MPI:Portable Parallel Programming with the Message Passing Interface. Scientific and Engineering computation Series. MIT Press, Cambridge (1994)Google Scholar
  9. 9.
    Geist, A., Beguelin, A., Dongarra, J., Jiang, W., Manchek, B., Sunderam, V.: PVM: Parallel Virtual Machine – A User’s Guide and Tutorial for Network Parallel Computing. MIT Press, Cambridge (1994)zbMATHGoogle Scholar
  10. 10.
    Dagum, L., Menon, R.: OpenMP: An industry-standard API for shared-memory programming. IEEE Computational Science and Engineering 5(1), 46–55 (1998)CrossRefGoogle Scholar
  11. 11.
    Zezula, P., Savino, P., Rabitti, F., Amato, G., Ciaccia, P.: Processing m-trees with parallel resources. In: RIDE 1998: Proceedings of the Workshop on Research Issues in Database Engineering, p. 147. IEEE Computer Society, Washington, DC (1998)Google Scholar
  12. 12.
    Alpkocak, A., Danisman, T., Ulker, T.: A parallel similarity search in high dimensional metric space using M-tree. In: Grigoras, D., Nicolau, A., Toursel, B., Folliot, B. (eds.) IWCC 2001. LNCS, vol. 2326, pp. 166–252. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  13. 13.
    Marin, M., Uribe, R., Barrientos, R.J.: Searching and updating metric space databases using the parallel EGNAT. In: Shi, Y., van Albada, G.D., Dongarra, J., Sloot, P.M.A. (eds.) ICCS 2007. LNCS, vol. 4487, pp. 229–236. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  14. 14.
    Gil-Costa, V., Marin, M., Reyes, N.: Parallel query processing on distributed clustering indexes. Journal of Discrete Algorithms 7(1), 3–17 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Gil-Costa, V., Barrientos, R., Marin, M., Bonacic, C.: Scheduling metric-space queries processing on multi-core processors. In: Euromicro Conference on Parallel, Distributed, and Network-Based Processing, pp. 187–194 (2010)Google Scholar
  16. 16.
    Chávez, E., Marroquín, J., Baeza-Yates, R.: Spaghettis: An array based algorithm for similarity queries in metric spaces. In: 6th International Symposium on String Processing and Information Retrieval (SPIRE 1999), pp. 38–46. IEEE CS Press, Los Alamitos (1999)Google Scholar
  17. 17.
    Wu-Feng, Manocha, D.: High-performance computing using accelerators. Parallel Computing 33, 645–647 (2007)CrossRefGoogle Scholar
  18. 18.
    GPGPU, general-purpose computation using graphics hardware,
  19. 19.
    NVIDIA CUDA Compute Unified Device Architecture-Programming Guide, Version 2.3. NVIDIA (2009),
  20. 20.
    Kuang, Q., Zhao, L.: A practical GPU based kNN algorithm. In: International Symposium on Computer Science and Computational Technology (ISCSCT), pp. 151–155 (2009)Google Scholar
  21. 21.
    Garcia, V., Debreuve, E., Barlaud, M.: Fast k nearest neighbor search using GPU. In: Computer Vision and Pattern Recognition Workshop, pp. 1–6 (2008)Google Scholar
  22. 22.
    Bustos, B., Deussen, O., Hiller, S., Keim, D.A.: A graphics hardware accelerated algorithm for nearest neighbor search. In: Alexandrov, V.N., van Albada, G.D., Sloot, P.M.A., Dongarra, J. (eds.) ICCS 2006. LNCS, vol. 3994, pp. 196–199. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  23. 23.
    Satish, N., Harris, M., Garland, M.: Designing efficient sorting algorithms for manycore GPUs. In: Parallel and Distributed Processing Symposium, International, pp. 1–10 (2009)Google Scholar
  24. 24.
    Barrientos, R.J., Gómez, J.I., Tenllado, C., Prieto, M.: Heap based k-nearest neighbor search on GPUs. In: Congreso Español de Informática (CEDI), Valencia, Septiembre (2010)Google Scholar
  25. 25.
    Micó, L., Oncina, J., Vidal, E.: A new version of the nearest-neighbor approximating and eliminating search (AESA) with linear preprocessing-time and memory requirements. Pattern Recognition Letters 15, 9–17 (1994)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Roberto Uribe-Paredes
    • 1
    • 2
  • Pedro Valero-Lara
    • 3
  • Enrique Arias
    • 4
  • José L. Sánchez
    • 4
  • Diego Cazorla
    • 4
  1. 1.Computer Engineering DepartmentUniversity of Magallanes, UMAGPunta ArenasChile
  2. 2.Database Group - UARTNational University of Patagonia AustralSanta CruzArgentina
  3. 3.Albacete Research Institute of InformaticsUniversity of Castilla-La ManchaAlbaceteEspaña
  4. 4.Computing Systems DeptUniversity of Castilla-La ManchaAlbaceteEspaña

Personalised recommendations