Skip to content
This repository was archived by the owner on Oct 5, 2021. It is now read-only.

Commit 49cd8b5

Browse files
committed
Commit before format
1 parent 858a027 commit 49cd8b5

File tree

9 files changed

+29
-60
lines changed

9 files changed

+29
-60
lines changed

storage/innobase/btr/btr0cur.cc

+6-18
Original file line numberDiff line numberDiff line change
@@ -856,10 +856,10 @@ btr_cur_search_child_page_no(
856856
/*========================*/
857857
dict_index_t* index, /*!< in: index */
858858
ulint level, /*!< in: the tree level of search */
859-
dtuple_t** clust_tuple,
860-
prefetch_t* prefetch,
861-
ulint* count,
862-
ulint ref_count,
859+
dtuple_t** tuple, /*<! in: search tuple list: prebuilt->clust_ref_list */
860+
prefetch_t* prefetch, /*<! in/out: store space number and page number for AIO Prefetch */
861+
ulint* page_count, /*<! in/out: the number of pages in PREFETCH */
862+
ulint ref_count, /*<! in/out: the number of tuples in search tuple list */
863863
ulint mode, /*!< in: PAGE_CUR_L, ...;
864864
NOTE that if the search is made using a unique
865865
prefix of a record, mode should be PAGE_CUR_LE,
@@ -1096,12 +1096,9 @@ btr_cur_search_child_page_no(
10961096
}
10971097

10981098
/* If this is the desired level, leave the loop */
1099-
1100-
ut_ad(height == btr_page_get_level(page_cur_get_page(page_cursor),
1101-
mtr));
1099+
ut_ad(height == btr_page_get_level(page_cur_get_page(page_cursor), mtr));
11021100

11031101
if (level != height) {
1104-
11051102
const rec_t* node_ptr;
11061103
ut_ad(height > 0);
11071104

@@ -1129,17 +1126,8 @@ btr_cur_search_child_page_no(
11291126
}
11301127

11311128
/*==============PHASE 2. SORT =============*//**/
1132-
// std::sort(prefetch_info, prefetch_info + page_count);
11331129
qsort(prefetch_info, page_count, sizeof(prefetch_t), prefetch_info_cmp);
1134-
/*
1135-
last = 0;
1136-
for(ulint i = 1; i < page_count; i++) {
1137-
if(!((prefetch_info[last].space_no == prefetch_info[i].space_no)
1138-
&& (prefetch_info[last].page_no == prefetch_info[i].page_no))) {
1139-
prefetch_info[++last] = prefetch_info[i];
1140-
}
1141-
}
1142-
*/
1130+
11431131
*(count) = page_count;
11441132

11451133
if (UNIV_LIKELY_NULL(heap)) {

storage/innobase/include/aio0prefetch.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ extern aio_prefetch_array_n;
3939
#endif
4040

4141
/* Activate Prefetch*/
42-
#define AIO_PREFETCH 1
42+
#define AIO_PREFETCH 0
4343

4444
#endif
4545

storage/innobase/include/btr0pcur.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,11 @@ btr_pcur_open_for_page_no_low(
222222
/*=============*/
223223
dict_index_t* index, /*!< in: index */
224224
ulint level, /*<! in: level in the btree */
225-
dtuple_t** tuple,
226-
prefetch_t* prefetch,
227-
ulint* page_count,
228-
ulint ref_count,
229-
btr_pcur_t* prefetch_cursor,
225+
dtuple_t** tuple, /*<! in: search tuple list: prebuilt->clust_ref_list */
226+
prefetch_t* prefetch, /*<! in/out: store space number and page number for AIO Prefetch */
227+
ulint* page_count, /*<! in/out: the number of pages in PREFETCH */
228+
ulint ref_count, /*<! in: the number of tuples in search tuple list */
229+
btr_pcur_t* prefetch_cursor, /*<! in: a cursor for AIO Prefetch */
230230
ulint mode, /*<! in: PAGE_CUR_L, ...;
231231
NOTE that if the search is made using a unique
232232
prefix of a record, mode should be

storage/innobase/include/btr0pcur.ic

+5-5
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,11 @@ btr_pcur_open_for_page_no_low(
560560
/*=============*/
561561
dict_index_t* index, /*!< in: index */
562562
ulint level, /*<! in: level in the btree */
563-
dtuple_t** tuple,
564-
prefetch_t* prefetch,
565-
ulint* page_count,
566-
ulint ref_count,
567-
btr_pcur_t* prefetch_cursor,
563+
dtuple_t** tuple, /*<! in: search tuple list: prebuilt->clust_ref_list */
564+
prefetch_t* prefetch, /*<! in/out: store space number and page number for AIO Prefetch */
565+
ulint* page_count, /*<! in/out: the number of pages in PREFETCH */
566+
ulint ref_count, /*<! in/out: the number of tuples in search tuple list */
567+
btr_pcur_t* prefetch_cursor, /*<! in: a cursor for AIO Prefetch */
568568
ulint mode, /*<! in: PAGE_CUR_L, ...;
569569
NOTE that if the search is made using a unique
570570
prefix of a record, mode should be

storage/innobase/include/data0data.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -532,9 +532,8 @@ struct big_rec_t {
532532

533533
/** A structure to contain AIO Prefetch information. */
534534
typedef struct prefetch_struct {
535-
// uint32 index;
536-
ulint space_no;
537-
ulint page_no;
535+
ulint space_no; /*!< I/O-desired tablespace number */
536+
ulint page_no; /*!< I/O-desired page number */
538537
}prefetch_t;
539538

540539
#ifndef UNIV_NONINL

storage/innobase/include/row0mysql.h

+6-7
Original file line numberDiff line numberDiff line change
@@ -880,16 +880,15 @@ struct row_prebuilt_t {
880880
to InnoDB format.*/
881881
uint srch_key_val_len; /*!< Size of search key */
882882
#ifdef AIO_PREFETCH
883-
btr_pcur_t prefetch_pcur;
884-
rec_t** ref_list; /* Array for secodary index records.*/
885-
dtuple_t** clust_ref_list; /* Array for reference tuples extracted from rec_list.*/
886-
prefetch_t* prefetch_info; /* Array for AIO_Prefetch.
887-
Eliminate duplicated information. */
883+
btr_pcur_t prefetch_pcur; /*!< persistent cursor used in prefetch */
884+
rec_t** ref_list; /* array for secodary index records.*/
885+
dtuple_t** clust_ref_list; /* array for reference tuples extracted from rec_list.*/
886+
prefetch_t* prefetch_info; /* array for AIO_Prefetch. */
888887
ulint ref_count; /* # of records for AIO_Prefetch. */
889888
ulint page_count; /* # of elements in prefetch_info. */
890889
ulint read_count; /* # of clust records read after AIO_PREFETCH. */
891-
ibool aio_prefetch_enabled; /* Able to prefetch or not. */
892-
ibool ref_gathering_done; /* Check a proper amount of records are collected. */
890+
ibool aio_prefetch_enabled; /* enable to do prefetch or not. */
891+
ibool ref_gathering_done; /* check if a proper # of records are collected. */
893892
#endif
894893
};
895894

storage/innobase/os/os0file.cc

+4-13
Original file line numberDiff line numberDiff line change
@@ -4527,9 +4527,6 @@ os_aio_linux_dispatch_read_array_submit()
45274527
ulint slots_per_segment;
45284528
ulint iocb_index;
45294529
ulint submitted;
4530-
4531-
/* Do we need to consider and check outstanding AIO request threshold?
4532-
It may depend on storages. */
45334530

45344531
os_mutex_enter(array->mutex);
45354532

@@ -4551,9 +4548,6 @@ os_aio_linux_dispatch_read_array_submit()
45514548
errno = -submitted;
45524549
break;
45534550
}
4554-
#if 0
4555-
fprintf(stderr, "[AIO_SUBMIT] count[%lu]: %lu, submitted: %lu\n", i, count, submitted);
4556-
#endif
45574551
array->global_count -= submitted;
45584552
array->submitted[i] = submitted;
45594553

@@ -4562,9 +4556,6 @@ os_aio_linux_dispatch_read_array_submit()
45624556
sizeof(struct iocb*) * slots_per_segment);
45634557
array->count[i] = 0;
45644558
os_mutex_exit(array->mutex);
4565-
4566-
/* Need to add statistics. */
4567-
//srv_stats.n_aio_submitted.add(submitted);
45684559
}
45694560
}
45704561
#endif
@@ -4579,8 +4570,8 @@ os_aio_linux_dispatch(
45794570
/*==================*/
45804571
os_aio_array_t* array, /*!< in: io request array. */
45814572
os_aio_slot_t* slot, /*!< in: an already reserved slot. */
4582-
ibool batch_aio,
4583-
ulint batch_size)
4573+
ibool batch_aio, /*!<in: determine to submit a bunch of aio requests in an array. */
4574+
ulint batch_size) /*!<in: how many aio requests are submitted simultaneously.*/
45844575
{
45854576
int ret;
45864577
ulint io_ctx_index;
@@ -4610,11 +4601,11 @@ os_aio_linux_dispatch(
46104601
array->global_count++;
46114602
// count = array->count[io_ctx_index];
46124603
count = array->global_count;
4613-
#if !DASOM
4604+
#if 0
46144605
fprintf(stderr, "[AIO_DISPATCH] total: %lu, count[%lu]: %lu\n", array->global_count, io_ctx_index, array->count[io_ctx_index]);
46154606
#endif
46164607
os_mutex_exit(array->mutex);
4617-
/* Current : aio_preftch unit == slots_per_segment. -- will be fixed. */
4608+
/* Current : MAX batch_aio unit == slots_per_segment. -- will be fixed. */
46184609
/*fprintf(stderr, "[AIO_DISPATCH] count[%lu]: %lu\n", io_ctx_index, array->count[io_ctx_index]);*/
46194610
if(count >= batch_size || count >= array->n_slots) {
46204611
os_aio_linux_dispatch_read_array_submit();

storage/innobase/row/row0mysql.cc

-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,6 @@ row_create_prebuilt(
875875
prebuilt->ref_list[i] = NULL;
876876
ref = dtuple_create(heap, ref_len);
877877
prebuilt->clust_ref_list[i] = ref;
878-
// prebuilt->prefetch_info[i].index = i;
879878
}
880879
}
881880

storage/innobase/row/row0sel.cc

-7
Original file line numberDiff line numberDiff line change
@@ -3019,12 +3019,6 @@ row_sel_prefetch(
30193019
access the clustered index */
30203020
{
30213021
dict_index_t* clust_index;
3022-
/*ulint ;
3023-
ulint ;
3024-
dtuple_t** ;
3025-
prefetch_t* ;
3026-
btr_pcur_t* ;
3027-
*/
30283022
ibool succeed;
30293023

30303024
clust_index = dict_table_get_first_index(sec_index->table);
@@ -3036,7 +3030,6 @@ row_sel_prefetch(
30363030

30373031
if(succeed) {
30383032
ibool submitted = buf_async_prefetch(prebuilt->prefetch_info, prebuilt->page_count);
3039-
// if(submitted != 0)
30403033
return submitted;
30413034
}
30423035
return (FALSE);

0 commit comments

Comments
 (0)