reswqa commented on PR #19234:
URL: https://github.com/apache/doris/pull/19234#issuecomment-1538683765

   @morrySnow Good question. In this PR's implementation, only after all 
indexes of a partition are deleted will the partition be deleted (The effect is 
the same as the `drop partition` statement). As for only partial index were 
deleted:
   - If we only drop `base Index` and keep `mv index` for a specific partition, 
then queries that can hit mv can work correctly. This should be covered by the 
modified regression test in this PR as following:
   ```
        // drop base index.
        sql""" ALTER TABLE ${testTable} DROP PARTITION p1 FROM INDEX 
${testTable} """
        explain {
          sql(" SELECT k1, k2+k3 FROM ${testTable} PARTITION(p1); ")
          contains "(${testMv})"
        }
        qt_select """ SELECT k1, k2+k3 FROM ${testTable} PARTITION(p1) """
   ```
   - If we only drop `mv index` for a specific partition. After checking the 
code, I found queries that can hit mv will indeed encounter some problems, such 
as NPE. Not sure if it requires significant changes to be compatible with this 
situation as I am not familiar with the selection algorithm of materialized 
view. If that's the case, I somehow tend to temporarily not support deleting 
non-based index through the `Drop partition from index` statement. One main 
reason is that our initial purpose in doing this work was to separate the 
lifecycle of mv and base table, so that the query can still be performed based 
on mv. WDYT?
   
   If I missed something, please feel free to point me out 🙇.  Also cc 
@dataroaring for the more advanced insights.


-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to