Skip to content

[Bug]: Problem with RuntimeFilter of SEMI join, when we use 2 conditions in OnList #15196

Closed

Description

@arjunsk

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

0f8bdbb

Commit ID

fbe579d

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

WeChatWorkScreenshot_2a560d33-bfbf-4bfc-9af5-7cc25b1b3ce5

Expected Behavior

It shouldn't be outputting 0. instead something like 3000-10,000 rows

Steps to Reproduce

  1. Run the branch: https://github.com/arjunsk/matrixone/tree/bug/add-vector-to-entries-table
  2. Download the SQL import file from S3.
  3. Import using below query

source /Users/arjunsunilkumar/GolandProjects/mo_dump/sift128_no_index.sql

  1. Once the table is imported, run
mysql> create index idx3 using ivfflat on t3(b) lists=500 op_type "vector_l2_ops";
Query OK, 0 rows affected (6 min 8.79 sec)
  1. Run the query
explain analyze SELECT a FROM t3 ORDER BY l2_distance(b,'[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]') ASC LIMIT 100;

Additional information

Most of the things were discussed in the Group Chat. If any additional details are required, please feel free to ping me.

Activity

  1. added
    kind/bug
    on Mar 27, 2024
  2. added this to the 1.2.0 milestone on Mar 27, 2024
  3. added
    severity/s0
    and removed on Mar 27, 2024
  4. aunjgr commented on Mar 29, 2024

    @aunjgr
    Contributor

    My fix PR #15233 has been merged. Please confirm that it works. Thank you.

  5. assigned and unassigned on Mar 29, 2024
  6. arjunsk commented on Mar 29, 2024

    @arjunsk
    ContributorAuthor

    The New Plan with {condition1, condition2}

    mysql> explain analyze
        -> SELECT a,b FROM t3 ORDER BY l2_distance(b,'[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]') ASC LIMIT 100;
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | QUERY PLAN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Project                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |   Analyze: timeConsumed=0ms waitTime=3ms inputRows=0 outputRows=0 InputSize=0bytes OutputSize=0bytes MemorySize=0bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
    |   ->  Sort                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
    |         Analyze: timeConsumed=0ms waitTime=6ms inputRows=0 outputRows=0 InputSize=0bytes OutputSize=0bytes MemorySize=0bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    |         Sort Key: l2_distance(#[0,1], cast('[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]' AS VECF32)) ASC                                                                                                  |
    |         Limit: 100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
    |         ->  Join                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
    |               Analyze: timeConsumed=0ms probe_time=[total=0ms,min=0ms,max=0ms,dop=10] build_time=[0ms] waitTime=39ms inputRows=1 outputRows=0 InputSize=16bytes OutputSize=0bytes MemorySize=361179bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    |               Join Type: SEMI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
    |               Join Cond: (__mo_index_secondary_018e8915-4da4-7bc0-a32e-ee615e7e9939.__mo_index_centroid_fk_id = __mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid_id), (__mo_index_secondary_018e8915-4da4-7bc0-a32e-ee615e7e9939.__mo_index_centroid_fk_version = __mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid_version)                                                                                                                                                                                                                                                                                                                                                                                                        |
    |               Runtime Filter Build: serial(#[-1,0], #[-1,1])                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    |               ->  Table Scan on a.__mo_index_secondary_018e8915-4da4-7bc0-a32e-ee615e7e9939                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
    |                     Analyze: timeConsumed=0ms waitTime=0ms inputRows=0 outputRows=0 InputSize=0bytes OutputSize=0bytes MemorySize=0bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    |                     Runtime Filter Probe: #[0,4] Match Prefix                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
    |               ->  Sort                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
    |                     Analyze: timeConsumed=0ms waitTime=4ms inputRows=0 outputRows=1 InputSize=0bytes OutputSize=16bytes MemorySize=4032bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    |                     Sort Key: l2_distance(__mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid, normalize_l2(cast('[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]' AS VECF32))) ASC |
    |                     Limit: CASE WHEN (@probe_limit IS NULL) THEN 1 ELSE cast(@probe_limit AS BIGINT) END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    |                     ->  Join                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    |                           Analyze: timeConsumed=0ms probe_time=[total=0ms,min=0ms,max=0ms,dop=10] build_time=[0ms] waitTime=13ms inputRows=501 outputRows=500 InputSize=276024bytes OutputSize=276000bytes MemorySize=180875bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
    |                           Join Type: INNER                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
    |                           Join Cond: (__mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid_version = cast(__mo_index_secondary_018e8915-4da4-7176-908a-1a24f9563a6c.__mo_index_val AS BIGINT))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                           Runtime Filter Build: #[-1,0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                           ->  Table Scan on a.__mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                                 Analyze: timeConsumed=0ms waitTime=0ms inputRows=500 outputRows=500 InputSize=276000bytes OutputSize=276000bytes MemorySize=552500bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                                 Runtime Filter Probe: __mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid_version                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
    |                           ->  Table Scan on a.__mo_index_secondary_018e8915-4da4-7176-908a-1a24f9563a6c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                                 Analyze: timeConsumed=0ms waitTime=0ms inputRows=1 outputRows=1 InputSize=48bytes OutputSize=24bytes MemorySize=73bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                                 Filter Cond: (__mo_index_secondary_018e8915-4da4-7176-908a-1a24f9563a6c.__mo_index_key = 'version')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    29 rows in set (0.01 sec)

    Output:

    mysql> SELECT a,b FROM t3 ORDER BY l2_distance(b,'[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]') ASC LIMIT 100;
    
    Empty set (0.00 sec)
    

    Plan using AND instead of {condition1, condition2}

    mysql> explain analyze
        -> SELECT a,b FROM t3 ORDER BY l2_distance(b,'[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]') ASC LIMIT 100;
    ERROR 2013 (HY000): Lost connection to MySQL server during query
    No connection. Trying to reconnect...
    Connection id:    24206
    Current database: a
    
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | QUERY PLAN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Project                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |   Analyze: timeConsumed=0ms waitTime=415ms inputRows=100 outputRows=100 InputSize=54000bytes OutputSize=54000bytes MemorySize=54000bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    |   ->  Sort                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
    |         Analyze: timeConsumed=2ms waitTime=831ms inputRows=0 outputRows=100 InputSize=0bytes OutputSize=54000bytes MemorySize=116200bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
    |         Sort Key: l2_distance(#[0,1], cast('[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]' AS VECF32)) ASC                                                                                                  |
    |         Limit: 100                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
    |         ->  Join                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
    |               Analyze: timeConsumed=1269ms probe_time=[total=1269ms,min=103ms,max=135ms,dop=10] build_time=[0ms] waitTime=3238ms inputRows=1000001 outputRows=7515 InputSize=530mb OutputSize=3mb MemorySize=16bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
    |               Join Type: SEMI                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
    |               Join Cond: ((__mo_index_secondary_018e8915-4da4-7bc0-a32e-ee615e7e9939.__mo_index_centroid_fk_id = __mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid_id) and (__mo_index_secondary_018e8915-4da4-7bc0-a32e-ee615e7e9939.__mo_index_centroid_fk_version = __mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid_version))                                                                                                                                                                                                                                                                                                                                                                                                   |
    |               ->  Table Scan on a.__mo_index_secondary_018e8915-4da4-7bc0-a32e-ee615e7e9939                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
    |                     Analyze: timeConsumed=2961ms scan_time=[total=2961ms,min=349ms,max=383ms,dop=8] waitTime=314ms inputRows=1000000 outputRows=1000000 InputSize=530mb OutputSize=530mb MemorySize=69mb                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    |               ->  Sort                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
    |                     Analyze: timeConsumed=0ms waitTime=4ms inputRows=0 outputRows=1 InputSize=0bytes OutputSize=16bytes MemorySize=4032bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    |                     Sort Key: l2_distance(__mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid, normalize_l2(cast('[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]' AS VECF32))) ASC |
    |                     Limit: CASE WHEN (@probe_limit IS NULL) THEN 1 ELSE cast(@probe_limit AS BIGINT) END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
    |                     ->  Join                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
    |                           Analyze: timeConsumed=0ms probe_time=[total=0ms,min=0ms,max=0ms,dop=10] build_time=[0ms] waitTime=13ms inputRows=501 outputRows=500 InputSize=276024bytes OutputSize=276000bytes MemorySize=180875bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
    |                           Join Type: INNER                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
    |                           Join Cond: (__mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid_version = cast(__mo_index_secondary_018e8915-4da4-7176-908a-1a24f9563a6c.__mo_index_val AS BIGINT))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                           Runtime Filter Build: #[-1,0]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                           ->  Table Scan on a.__mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                                 Analyze: timeConsumed=0ms waitTime=0ms inputRows=500 outputRows=500 InputSize=276000bytes OutputSize=276000bytes MemorySize=552500bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                                 Runtime Filter Probe: __mo_index_secondary_018e8915-4da4-7217-b661-3dff2250d2af.__mo_index_centroid_version                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
    |                           ->  Table Scan on a.__mo_index_secondary_018e8915-4da4-7176-908a-1a24f9563a6c                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                                 Analyze: timeConsumed=0ms waitTime=0ms inputRows=1 outputRows=1 InputSize=48bytes OutputSize=24bytes MemorySize=73bytes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
    |                                 Filter Cond: (__mo_index_secondary_018e8915-4da4-7176-908a-1a24f9563a6c.__mo_index_key = 'version')                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
    +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    27 rows in set (0.42 sec)
    
    

    Output:

    | 843563 | [4, 5, 17, 15, 0, 18, 21, 0, 8, 4, 5, 0, 0, 88, 85, 3, 3, 0, 0, 1, 7, 19, 122, 38, 10, 1, 0, 0, 0, 0, 32, 25, 0, 0, 0, 12, 89, 111, 36, 0, 0, 0, 4, 17, 36, 122, 122, 29, 53, 0, 1, 0, 0, 16, 101, 122, 96, 13, 0, 0, 0, 0, 11, 53, 5, 1, 0, 86, 101, 20, 23, 10, 0, 1, 24, 122, 102, 18, 13, 10, 122, 59, 25, 23, 5, 0, 10, 71, 122, 23, 1, 0, 3, 3, 10, 37, 16, 18, 5, 23, 24, 0, 6, 7, 0, 11, 49, 112, 65, 0, 0, 0, 20, 98, 98, 19, 3, 0, 0, 1, 31, 23, 8, 5, 0, 3, 11, 14]                      |
    | 287108 | [2, 5, 43, 34, 9, 18, 0, 0, 20, 40, 38, 22, 10, 26, 43, 16, 44, 25, 0, 1, 2, 6, 104, 63, 0, 0, 1, 8, 48, 27, 23, 11, 3, 1, 0, 3, 35, 125, 18, 3, 0, 0, 0, 12, 67, 125, 125, 9, 70, 4, 0, 1, 3, 22, 125, 125, 109, 10, 19, 14, 8, 5, 16, 77, 7, 0, 0, 16, 29, 64, 39, 20, 2, 4, 38, 125, 103, 26, 6, 3, 104, 125, 94, 37, 7, 7, 11, 33, 125, 48, 5, 1, 1, 1, 2, 41, 53, 8, 0, 1, 0, 10, 9, 23, 18, 44, 59, 32, 6, 0, 0, 5, 2, 79, 76, 8, 6, 11, 6, 0, 17, 15, 2, 0, 0, 6, 14, 35]                    |
    +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    100 rows in set (0.43 sec)
    
    

    NOTE

    To toggle, use this flag: https://github.com/arjunsk/matrixone/pull/85/commits/738c30b241bd22ce11573f0cbaf02ed16bb3e289

  7. assigned and unassigned on Mar 29, 2024
  8. arjunsk commented on Apr 11, 2024

    @arjunsk
    ContributorAuthor

    This issue is not solved.

    In the current master, you can replicate this issue by following these steps.

    1. Run the master branch (d352b9f) by changing this JoinOnType to 2 here.
    2. Download the SQL import file from S3.
    3. Import using below query
    source /Users/arjunsunilkumar/GolandProjects/mo_dump/sift128_no_index.sql
    1. Once the table is imported, run
    SET GLOBAL experimental_ivf_index = 1;
    
    mysql> create index idx3 using ivfflat on t3(b) lists=500 op_type "vector_l2_ops";
    Query OK, 0 rows affected (6 min 8.79 sec)
    1. Run the query
    SELECT a FROM t3 ORDER BY l2_distance(b,'[1.0,3.0,11.0,110.0,62.0,22.0,4.0,0.0,43.0,21.0,22.0,18.0,6.0,28.0,64.0,9.0,11.0,1.0,0.0,0.0,1.0,40.0,101.0,21.0,20.0,2.0,4.0,2.0,2.0,9.0,18.0,35.0,1.0,1.0,7.0,25.0,108.0,116.0,63.0,2.0,0.0,0.0,11.0,74.0,40.0,101.0,116.0,3.0,33.0,1.0,1.0,11.0,14.0,18.0,116.0,116.0,68.0,12.0,5.0,4.0,2.0,2.0,9.0,102.0,17.0,3.0,10.0,18.0,8.0,15.0,67.0,63.0,15.0,0.0,14.0,116.0,80.0,0.0,2.0,22.0,96.0,37.0,28.0,88.0,43.0,1.0,4.0,18.0,116.0,51.0,5.0,11.0,32.0,14.0,8.0,23.0,44.0,17.0,12.0,9.0,0.0,0.0,19.0,37.0,85.0,18.0,16.0,104.0,22.0,6.0,2.0,26.0,12.0,58.0,67.0,82.0,25.0,12.0,2.0,2.0,25.0,18.0,8.0,2.0,19.0,42.0,48.0,11.0]') ASC LIMIT 100;
    1. If the output is 0, then the issue persists.
  9. assigned and unassigned on Apr 17, 2024
  10. arjunsk commented on Apr 17, 2024

    @arjunsk
    ContributorAuthor

    After this fix, I'm facing a different error which causes the query to hang for invalid vector input: #15572

    @aunjgr do you have any suggestions regarding the root cause?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions