summaryrefslogtreecommitdiff
path: root/sql/ha_partition.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-05-18 19:26:30 +0300
committerMichael Widenius <monty@askmonty.org>2011-05-18 19:26:30 +0300
commit3631146442bc09e5129334774b4bcdf2470a4b27 (patch)
treec812cd2520a8af89c95abf5e6fbec47998908c58 /sql/ha_partition.h
parent5c70f813f3d12974bf67d6ff98c0ff4b9ca71d7d (diff)
downloadmariadb-git-3631146442bc09e5129334774b4bcdf2470a4b27.tar.gz
Original idea from Zardosht Kasheff to add HA_CLUSTERED_INDEX
- Added a lot of code comments - Updated get_best_ror_intersec() to prefer index scan on not clustered keys before clustered keys. - Use HA_CLUSTERED_INDEX to define if one should use HA_MRR_INDEX_ONLY - For test of using index or filesort to resolve ORDER BY, use HA_CLUSTERED_INDEX flag instead of primary_key_is_clustered() - Use HA_TABLE_SCAN_ON_INDEX instead of primary_key_is_clustered() to decide if ALTER TABLE ... ORDER BY will have any effect. sql/ha_partition.h: Added comment with warning for code unsafe to use with multiple storage engines at the same time sql/handler.h: Added HA_CLUSTERED_INDEX. Documented primary_key_is_clustered() sql/opt_range.cc: Added code comments Updated get_best_ror_intersec() to ignore clustered keys. Optimized away cpk_scan_used and one instance of current_thd (Simpler code) Use HA_CLUSTERED_INDEX to define if one should use HA_MRR_INDEX_ONLY sql/sql_select.cc: Changed comment to #ifdef For test of using index or filesort to resolve ORDER BY, use HA_CLUSTERED_INDEX flag instead of primary_key_is_clustered() (Change is smaller than what it looks beause of indentation change) sql/sql_table.cc: Use HA_TABLE_SCAN_ON_INDEX instead of primary_key_is_clustered() to decide if ALTER TABLE ... ORDER BY will have any effect. storage/innobase/handler/ha_innodb.h: Added support for HA_CLUSTERED_INDEX storage/innodb_plugin/handler/ha_innodb.cc: Added support for HA_CLUSTERED_INDEX storage/xtradb/handler/ha_innodb.cc: Added support for HA_CLUSTERED_INDEX
Diffstat (limited to 'sql/ha_partition.h')
-rw-r--r--sql/ha_partition.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index b1e39cf4d22..49aa7103e1c 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -877,6 +877,10 @@ public:
*/
virtual ulong index_flags(uint inx, uint part, bool all_parts) const
{
+ /*
+ The following code is not safe if you are using different
+ storage engines or different index types per partition.
+ */
return m_file[0]->index_flags(inx, part, all_parts);
}