kckoh commented on issue #62025:
URL: https://github.com/apache/airflow/issues/62025#issuecomment-3976769665

   @pierrejeambrun  
   I tested changing the default sort to  `id` and confirmed the improvement.
                                                            
     The key difference is that `USE TEMP B-TREE FOR ORDER BY` is eliminated 
when sorting by `id` (rowid),
     since SQLite can satisfy the ORDER BY directly via the
     primary key without an additional in-memory sort.
   
     **Before** (default sort: `run_after`):
     |--SEARCH dag_run USING INDEX dag_id_state (dag_id=?)
     |--SEARCH dag_1 USING INDEX sqlite_autoindex_dag_1
     (dag_id=?) LEFT-JOIN
     |--SEARCH dag_run_note_1 USING INTEGER PRIMARY KEY
     (rowid=?) LEFT-JOIN
     `--USE TEMP B-TREE FOR ORDER BY
   
     **After** (default sort: `id`):
     |--SEARCH dag_run USING INDEX idx_dag_run_dag_id
     (dag_id=?)
     |--SEARCH dag_1 USING INDEX sqlite_autoindex_dag_1
     (dag_id=?) LEFT-JOIN
     `--SEARCH dag_run_note_1 USING INTEGER PRIMARY KEY
     (rowid=?) LEFT-JOIN
   
   The temporary B-tree sort is gone. Shall I make a separate PR for this UI 
default sort change? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to