Skip to content

Commit 2507753

Browse files
committed
Moved things in TABLE to have all 'bool' variables in one place
This reduced size of TABLE from 1024 bytes to 992
1 parent de22bfc commit 2507753

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

sql/table.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,6 @@ struct TABLE
12841284

12851285
public:
12861286

1287-
uint32 instance; /** Table cache instance this TABLE is belonging to */
12881287
THD *in_use; /* Which thread uses this */
12891288

12901289
uchar *record[3]; /* Pointer to records */
@@ -1438,7 +1437,13 @@ struct TABLE
14381437
NULLable (and have NULL values when null_row=true)
14391438
*/
14401439
uint maybe_null;
1441-
int current_lock; /* Type of lock on table */
1440+
uint max_keys; /* Size of allocated key_info array. */
1441+
int current_lock; /* Type of lock on table */
1442+
/* Number of cost info elements for possible range filters */
1443+
uint range_rowid_filter_cost_info_elems;
1444+
uint32 instance; /** Table cache instance this TABLE is belonging to */
1445+
1446+
/* variables of type bool */
14421447
bool copy_blobs; /* copy_blobs when storing */
14431448
/*
14441449
Set if next_number_field is in the UPDATE fields of INSERT ... ON DUPLICATE
@@ -1525,7 +1530,6 @@ struct TABLE
15251530
*/
15261531
bool alias_name_used; /* true if table_name is alias */
15271532
bool get_fields_in_item_tree; /* Signal to fix_field */
1528-
List<Virtual_column_info> vcol_refix_list;
15291533
private:
15301534
bool m_needs_reopen;
15311535
bool created; /* For tmp tables. TRUE <=> tmp table was actually created.*/
@@ -1536,7 +1540,15 @@ struct TABLE
15361540
#endif
15371541
/* Temporary value used by binlog_write_table_maps(). Does not need init */
15381542
bool restore_row_logging;
1543+
bool stats_is_read; /* Persistent statistics is read for the table */
1544+
bool histograms_are_read;
1545+
#ifdef WITH_PARTITION_STORAGE_ENGINE
1546+
/* If true, all partitions have been pruned away */
1547+
bool all_partitions_pruned_away;
1548+
#endif
1549+
bool vers_write; // For versioning
15391550

1551+
List<Virtual_column_info> vcol_refix_list;
15401552
REGINFO reginfo; /* field connections */
15411553
MEM_ROOT mem_root;
15421554
/* this is for temporary tables created inside Item_func_group_concat */
@@ -1555,12 +1567,7 @@ struct TABLE
15551567
Query_arena *expr_arena;
15561568
#ifdef WITH_PARTITION_STORAGE_ENGINE
15571569
partition_info *part_info; /* Partition related information */
1558-
/* If true, all partitions have been pruned away */
1559-
bool all_partitions_pruned_away;
15601570
#endif
1561-
uint max_keys; /* Size of allocated key_info array. */
1562-
bool stats_is_read; /* Persistent statistics is read for the table */
1563-
bool histograms_are_read;
15641571
MDL_ticket *mdl_ticket;
15651572

15661573
/*
@@ -1772,8 +1779,6 @@ struct TABLE
17721779

17731780
key_map with_impossible_ranges;
17741781

1775-
/* Number of cost info elements for possible range filters */
1776-
uint range_rowid_filter_cost_info_elems;
17771782
/* Pointer to the array of cost info elements for range filters */
17781783
Range_rowid_filter_cost_info *range_rowid_filter_cost_info;
17791784
/* The array of pointers to cost info elements for range filters */
@@ -1790,8 +1795,6 @@ struct TABLE
17901795
/**
17911796
System Versioning support
17921797
*/
1793-
bool vers_write;
1794-
17951798
bool versioned() const
17961799
{
17971800
return s->versioned;

0 commit comments

Comments
 (0)