|
29 | 29 | #include"machine_learning.h" |
30 | 30 | #include"preprocessing.h" |
31 | 31 | #include"learn_cache.h" |
| 32 | +#include"storage.h" |
32 | 33 |
|
33 | 34 |
|
34 | 35 | typedefstruct |
@@ -823,7 +824,12 @@ aqo_ExecutorEnd(QueryDesc *queryDesc) |
823 | 824 | } |
824 | 825 |
|
825 | 826 | if (query_context.collect_stat) |
826 | | -stat=get_aqo_stat(query_context.query_hash); |
| 827 | +{ |
| 828 | +if (!aqo_use_file_storage) |
| 829 | +stat=get_aqo_stat(query_context.query_hash); |
| 830 | +else |
| 831 | +stat=aqo_load_stat(query_context.query_hash); |
| 832 | +} |
827 | 833 |
|
828 | 834 | { |
829 | 835 | /* Calculate execution time. */ |
@@ -873,7 +879,10 @@ aqo_ExecutorEnd(QueryDesc *queryDesc) |
873 | 879 | automatical_query_tuning(query_context.query_hash,stat); |
874 | 880 |
|
875 | 881 | /* Write AQO statistics to the aqo_query_stat table */ |
876 | | -update_aqo_stat(query_context.query_hash,stat); |
| 882 | +if (!aqo_use_file_storage) |
| 883 | +update_aqo_stat(query_context.query_hash,stat); |
| 884 | +else |
| 885 | +aqo_store_stat(query_context.query_hash,stat); |
877 | 886 | pfree_query_stat(stat); |
878 | 887 | } |
879 | 888 |
|
|