fts5bigpl.test 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # 2015 April 21
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  6. # May you do good and not evil.
  7. # May you find forgiveness for yourself and forgive others.
  8. # May you share freely, never taking more than you give.
  9. #
  10. #***********************************************************************
  11. #
  12. # This test is focused on really large position lists. Those that require
  13. # 4 or 5 byte position-list size varints. Because of the amount of memory
  14. # required, these tests only run on 64-bit platforms.
  15. #
  16. source [file join [file dirname [info script]] fts5_common.tcl]
  17. set testprefix fts5bigpl
  18. # If SQLITE_ENABLE_FTS5 is not defined, omit this file.
  19. ifcapable !fts5 {
  20. finish_test
  21. return
  22. }
  23. if { $tcl_platform(wordSize)<8 } {
  24. finish_test
  25. return
  26. }
  27. do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(x) }
  28. do_test 1.1 {
  29. foreach t {a b c d e f g h i j} {
  30. set doc [string repeat "$t " 1200000]
  31. execsql { INSERT INTO t1 VALUES($doc) }
  32. }
  33. execsql { INSERT INTO t1(t1) VALUES('integrity-check') }
  34. } {}
  35. do_test 1.2 {
  36. execsql { DELETE FROM t1 }
  37. foreach t {"a b" "b a" "c d" "d c"} {
  38. set doc [string repeat "$t " 600000]
  39. execsql { INSERT INTO t1 VALUES($doc) }
  40. }
  41. execsql { INSERT INTO t1(t1) VALUES('integrity-check') }
  42. } {}
  43. # 5-byte varint. This test takes 30 seconds or so on a 2014 workstation.
  44. # The generated database is roughly 635MiB.
  45. #
  46. do_test 2.1...slow {
  47. execsql { DELETE FROM t1 }
  48. foreach t {a} {
  49. set doc [string repeat "$t " 150000000]
  50. execsql { INSERT INTO t1 VALUES($doc) }
  51. }
  52. execsql { INSERT INTO t1(t1) VALUES('integrity-check') }
  53. } {}
  54. finish_test