skip to main content
research-article

Incrementally parallelizing database transactions with thread-level speculation

Published:10 March 2008Publication History
Skip Abstract Section

Abstract

With the advent of chip multiprocessors, exploiting intratransaction parallelism in database systems is an attractive way of improving transaction performance. However, exploiting intratransaction parallelism is difficult for two reasons: first, significant changes are required to avoid races or conflicts within the DBMS; and second, adding threads to transactions requires a high level of sophistication from transaction programmers. In this article we show how dividing a transaction into speculative threads solves both problems—it minimizes the changes required to the DBMS, and the details of parallelization are hidden from the transaction programmer. Our technique requires a limited number of small, localized changes to a subset of the low-level data structures in the DBMS. Through this method of incrementally parallelizing transactions, we can dramatically improve performance: on a simulated four-processor chip-multiprocessor, we improve the response time by 44--66% for three of the five TPC-C transactions, assuming the availability of idle processors.

References

  1. Akkary, H. and Driscoll, M. 1998. A dynamic multithreading processor. In Proceedings of MICRO-31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Arvind and Culler, D. 1986. Dataflow architectures. In Annual Reviews in Computer Science. Vol. 1. Palo Alto, CA. 225--253. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Berger, E. D., McKinley, K. S., Blumofe, R. D., and Wilson, P. R. 2000. Hoard: A scalable memory allocator for multithreaded applications. In Proceedings of the 9th ASPLOS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bhowmik, A. and Franklin, M. 2002. A general compiler framework for speculative multithreading. In Proceedings of the 14th SPAA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Colohan, C., Ailamaki, A., Steffan, J., and Mowry, T. 2006. Tolerating dependences between large speculative threads via sub-threads. In Proceedings of the 33rd ISCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Colohan, C. B. 2005. Applying thread-level speculation to database transactions. Ph.D. dissertation. Carnegie Mellon University, Pittsburgh, PA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Colohan, C. B., Ailamaki, A., Steffan., J. G., and Mowry, T. C. 2007. CMP support for large and dependent speculative threads. IEEE Trans. Paralled Distrib. Syst. 18, 8, 1041--1054. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Eggers, S. and Jeremiassen, T. 1991. Eliminating false sharing. In Proceedings of the 1991 International Conference on Parallel Processing. Vol. I. 377--381.Google ScholarGoogle Scholar
  9. Franklin, M. and Sohi, G. 1996. ARB: A hardware mechanism for dynamic reordering of memory references. IEEE Trans. Comput. 45, 5 (May), 552--571. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Garcia-Molina, H. and Salem, K. 1987. Sagas. In Proceedings of the 1987 ACM SIGMOD International Conference on Management of Data. ACM Press, New York, NY. 249--259. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Garzarán, M., Prvulovic, M., Llabería, J., Viñals, V., Rauchwerger, L., and Torrellas, J. 2003. Tradeoffs in buffering memory state for thread-level speculation in multiprocessors. In Proceedings of the 9th HPCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gharachorloo, K., Lenoski, D., Laudon, J., Gibbons, P., Gupta, A., and Hennessy, J. 1990. Memory consistency and event ordering in scalable shared-memory multiprocessors. In Proceedings of the 17th Annual International Symposium on Computer Architecture. 15--26. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Gopal, S., Vijaykumar, T., Smith, J., and Sohi, G. 1998. Speculative versioning cache. In Proceedings of the 4th HPCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Gray, J. 1993. The Benchmark Handbook for Transaction Processing Systems. Morgan-Kaufmann Publishers, San Francisco, CA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Gupta, M. and Nim, R. 1998. Techniques for speculative run-time parallelization of loops. In Proceedings of Supercomputing'98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Halstead, Jr., R. 1985. Multilisp: A language for concurrent symbolic computation. ACM Trans. Prog. Lang. Syst. 7, 4, 501--538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Hammond, L., Carlstrom, B. D., Wong, V., Hertzberg, B., Chen, M., Kozyrakis, C., and Olukotun, K. 2004a. Programming with transactional coherence and consistency (TCC). In Proceedings of the 11th ASPLOS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Hammond, L., Hubbert, B., Siu, M., Prabhu, M., Chen, M., and Olukotun, K. 2000. The Stanford Hydra CMP. IEEE Micro. 20, 2, 71--84. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Hammond, L., Wong, V., Chen, M., Carlstrom, B. D., Davis, J. D., Hertzberg, B., Prabhu, M. K., Wijaya, H., Kozyrakis, C., and Olukotun, K. 2004b. Transactional memory coherence and consistency. In Proceedings of the 31st ISCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Herlihy, M. and Moss, J. 1993. Transactional memory: Architectural support for lock-free data structures. In Proceedings of the 20th ISCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. IBM Corporation. 2004. IBM DB2 Universal Database Administration Guide: Performance. IBM Corporation, Yorktown Heights, NY.Google ScholarGoogle Scholar
  22. Jeremiassen, T. E. and Eggers, S. J. 1995. Reducing false sharing on shared memory multiprocessors through compile time data transformations. In PPOPP'95: Proceedings of the Fifth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. 179-- 188. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Johnson, T., Eigenmann, R., and Vijaykumar, T. 2004. Min-cut program decomposition for thread-level speculation. In Proceedings of the ACM SIGPLAN'04 Conference on Programming Language Design and Implementation. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Kaufmann, H. and Schek, H. 1996. Extending TP-monitors for intra-transaction parallelism. In Proceedings of the 4th PDIS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Knight, T. 1986. An architecture for mostly functional languages. In Proceedings of the ACM Lisp and Functional Programming Conference. 500--519. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Kung, H. and Robinson, J. 1981. On optimistic methods for concurrency control. ACM Trans. Database Syst. 6, 2, 213--226. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Mahlke, S., Chen, W., Gyllenhaal, J., and Hwu, W. 1992. Compiler code transformations for superscalar-based high-performance systems. In Proceedings of the International Conference on Supercomputing. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Marcuello, P. and González, A. 1999. Clustered speculative multithreaded processors. In Proceedings of the ACM International Conference on Supercomputing. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Martínez, J. F. and Torrellas, J. 2002. Speculative synchronization: Applying thread-level speculation to explicitly parallel applications. In Proceedings of the International Conference on Architectural Support for Programming Languages and Operating Systems (San Jose, CA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. McFarling, S. 1993. Combining branch predictors. Tech. rep. TN-36. Digital Western Research Laboratory, Palo Alto, CA.Google ScholarGoogle Scholar
  31. McWherter, D., Schroeder, B., Ailamaki, A., and Harchol-Balter, M. 2004. Priority mechanisms for OLTP and transactional Web applications. In Proceedings of the IEEE International Conference on Data Engineering. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. McWherter, D. T., Schroeder, B., Ailamaki, A., and Harchol-Balter, M. 2005. Improving preemptive prioritization via statistical characterization of OLTP locking. In Proceedings of the IEEE International Conference on Data Engineering. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Miller, J. and Lau, H. 2001. Microsoft SQL Server 2000 Resource Kit. Chapter RDBMS: Performance Tuning Guide for Data Warehousing. Microsoft Press: Redmond, WA. 575--653.Google ScholarGoogle Scholar
  34. Mohan, C., Haderle, D., Lindsay, B., Pirahesh, H., and Schwarz, P. 1992. ARIES: A transaction recovery method supporting fine-granularity locking and partial rollbacks using write-ahead logging. ACM Trans. Database Syst. 17, 1, 94--162. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Morrisett, G. and Herlihy, M. 1993. Optimistic parallelization. Tech. rep. CMU-CS-93-171. School of Computer Science, Carnegie Mellon University, Pittsburgh, PA.Google ScholarGoogle Scholar
  36. Olson, M., Bostic, K., and Seltzer, M. 1999. Berkeley DB. In Proceedings of the Summer Usenix Technical Conference. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Olukotun, K., Hammond, L., and Willey, M. 1999. Improving the performance of speculatively parallel applications on the hydra CMP. In Proceedings of the 13th Annual ACM International Conference on Supercomputing. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Ooi, C. L., Kim, S. W., Park, I., Eigenmann, R., Falsafi, B., and Vijaykumar, T. N. 2001. Multiplex: Unifying conventional and speculative thread-level parallelism on a chip multiprocessor. In Proceedings of the International Conference on Supercomputing. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Oplinger, J., Heine, D., and Lam, M. 1999. In search of speculative thread-level parallelism. In Proceedings of PACT '99. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Prabhu, M. and Olukotun, K. 2003. Using thread-level speculation to simplify manual parallelization. In Proceedings of the ACM SIGPLAN 2003 Symposium on Principles & Practice of Parallel Programming. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Prvulovic, M., Garzarán, M. J., Rauchwerger, L., and Torrellas, J. 2001. Removing architectural bottlenecks to the scalability of speculative parallelization. In Proceedings of the 28th ISCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Rajwar, R. and Goodman, J. 2001. Speculative lock elision: Enabling highly concurrent multithreaded execution. In Proceedings of the 34th Annual International Symposium on Microarchitecture. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Rauchwerger, L. and Padua, D. 1999. The LRPD test: Speculative run-time parallelization of loops with privatization and reduction parallelization. IEEE Trans. Parallel Distrib. Syst. 10, 2, 160--172. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Rotenberg, E., Jacobson, Q., Sazeides, Y., and Smith, J. 1997. Trace processors. In Proceedings of the 30th Annual IEEE/ACM International Symposium on Microarchitecture. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Rundberg, P. and Stenstrom, P. 2000. Low-cost thread-level data dependence speculation on multiprocessors. In Proceedings of the Fourth Workshop on Multithreaded Execution, Architecture and Compilation.Google ScholarGoogle Scholar
  46. Rys, M., Norrie, M., and Schek, H. 1996. Intra-transaction parallelism in the mapping of an object model to a relational multi-processor system. In Proceedings of the 22nd VLDB. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Shasha, D., Llirbat, F., Simon, E., and Valduriez, P. 1995. Transaction chopping: Algorithms and performance studies. ACM Trans. Database Syst. 20, 3, 325--363. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Shinnar, A., Tarditi, D., Plesko, M., and Steensgaard, B. 2004. Integrating support for undo with exception handling. Tech. rep. MSR-TR-2004-140. Microsoft Research. Redmond, WA.Google ScholarGoogle Scholar
  49. Silberschatz, A., Galvin, P., and Gagne, G. 2002. Operating System Concepts. John Wiley & Sons, New York, NY. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Sohi, G., Breach, S., and Vijaykumar, T. 1995. Multiscalar processors. In Proceedings of the 22nd ISCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Steffan, J., Colohan, C., and Mowry, T. 1997. Architectural support for thread-level data speculation. Tech. rep. CMU-CS-97-188. School of Computer Science, Carnegie Mellon University, Pittsburgh, PA.Google ScholarGoogle Scholar
  52. Steffan, J., Colohan, C., Zhai, A., and Mowry, T. 2000. A scalable approach to thread-level speculation. In Proceedings of ISCA 27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Steffan, J., Colohan, C., Zhai, A., and Mowry, T. 2002. Improving value communication for thread-level speculation. In Proceedings of the 8th HPCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Steffan, J. and Mowry, T. 1998. The potential for using thread-level data speculation to facilitate automatic parallellization. In Proceedings of the 4th HPCA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Steffan, J. G., Colohan, C. B., Zhai, A., and Mowry, T. C. 2005. The stampede approach to thread-level speculation. ACM Trans. Comput. Syst. 23, 3 (Aug.), 253--300. Google ScholarGoogle ScholarDigital LibraryDigital Library
  56. Torrellas, J., Lam, M., and Hennessy, J. 1990. Shared data placement optimizations to reduce multiprocessor cache miss rates. In Proceedings of the 1990 International Conference on Parallel Processing. Vol. II. 266--270.Google ScholarGoogle Scholar
  57. Transaction Processing Performance Council. 2005. TPC benchmark C standard specification revision 5.4. Go online to http://www.tpc.org.Google ScholarGoogle Scholar
  58. Tremblay, M. 1999. MAJC: Microprocessor architecture for Java computing. In Proceedings of HotChips '99.Google ScholarGoogle Scholar
  59. Vijaykumar, T. 1998. Compiling for the multiscalar architecture. Ph.D. dissertation. University of Wisconsin-Madison, Madison, WI. Google ScholarGoogle ScholarDigital LibraryDigital Library
  60. Yeager, K. 1996. The MIPS R10000 superscalar microprocessor. IEEE Micro 16, 2, 28--40. Google ScholarGoogle ScholarDigital LibraryDigital Library
  61. Zhai, A., Colohan, C., Steffan, J., and Mowry, T. 2002. Compiler optimization of scalar value communication between speculative threads. In Proceedings of the 10th ASPLOS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  62. Zhai, A., Colohan, C., Steffan, J., and Mowry, T. 2004. Compiler optimization of memory-resident value communication between speculative threads. In Proceedings of the International Symposium on Code Generation and Optimization. Google ScholarGoogle ScholarDigital LibraryDigital Library
  63. Zhang, Y., Rauchwerger, L., and Torrellas, J. 1999. Hardware for speculative parallelization of partially-parallel loops in DSM multiprocessors. In Proceedings of the 5th HPCA. 135--141. Google ScholarGoogle ScholarDigital LibraryDigital Library
  64. Zuzarte, C. 2005. Personal communication.Google ScholarGoogle Scholar

Index Terms

  1. Incrementally parallelizing database transactions with thread-level speculation

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader
            About Cookies On This Site

            We use cookies to ensure that we give you the best experience on our website.

            Learn more

            Got it!