CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
75 lines
1.7 KiB
Tcl
75 lines
1.7 KiB
Tcl
|
|
set testdir [file join [file dirname $argv0] .. .. test]
|
|
source $testdir/tester.tcl
|
|
|
|
ifcapable !rtree {
|
|
finish_test
|
|
return
|
|
}
|
|
|
|
set NROW 10000
|
|
set NQUERY 500
|
|
|
|
puts "Generating $NROW rows of data..."
|
|
set data [list]
|
|
for {set ii 0} {$ii < $NROW} {incr ii} {
|
|
set x1 [expr {rand()*1000}]
|
|
set x2 [expr {$x1+rand()*50}]
|
|
set y1 [expr {rand()*1000}]
|
|
set y2 [expr {$y1+rand()*50}]
|
|
lappend data $x1 $x2 $y1 $y2
|
|
}
|
|
puts "Finished generating data"
|
|
|
|
|
|
set sql1 {CREATE TABLE btree(ii INTEGER PRIMARY KEY, x1, x2, y1, y2)}
|
|
set sql2 {CREATE VIRTUAL TABLE rtree USING rtree(ii, x1, x2, y1, y2)}
|
|
puts "Creating tables:"
|
|
puts " $sql1"
|
|
puts " $sql2"
|
|
db eval $sql1
|
|
db eval $sql2
|
|
|
|
db eval "pragma cache_size=100"
|
|
|
|
puts -nonewline "Inserting into btree... "
|
|
flush stdout
|
|
set btree_time [time {db transaction {
|
|
set ii 1
|
|
foreach {x1 x2 y1 y2} $data {
|
|
db eval {INSERT INTO btree VALUES($ii, $x1, $x2, $y1, $y2)}
|
|
incr ii
|
|
}
|
|
}}]
|
|
puts "$btree_time"
|
|
|
|
puts -nonewline "Inserting into rtree... "
|
|
flush stdout
|
|
set rtree_time [time {db transaction {
|
|
set ii 1
|
|
foreach {x1 x2 y1 y2} $data {
|
|
incr ii
|
|
db eval {INSERT INTO rtree VALUES($ii, $x1, $x2, $y1, $y2)}
|
|
}
|
|
}}]
|
|
puts "$rtree_time"
|
|
|
|
|
|
puts -nonewline "Selecting from btree... "
|
|
flush stdout
|
|
set btree_select_time [time {
|
|
foreach {x1 x2 y1 y2} [lrange $data 0 [expr $NQUERY*4-1]] {
|
|
db eval {SELECT * FROM btree WHERE x1<$x1 AND x2>$x2 AND y1<$y1 AND y2>$y2}
|
|
}
|
|
}]
|
|
puts "$btree_select_time"
|
|
|
|
puts -nonewline "Selecting from rtree... "
|
|
flush stdout
|
|
set rtree_select_time [time {
|
|
foreach {x1 x2 y1 y2} [lrange $data 0 [expr $NQUERY*4-1]] {
|
|
db eval {SELECT * FROM rtree WHERE x1<$x1 AND x2>$x2 AND y1<$y1 AND y2>$y2}
|
|
}
|
|
}]
|
|
puts "$rtree_select_time"
|