Commit 5bad0950 authored by Stanley Clark's avatar Stanley Clark 🦄
Browse files

Analysis of today

parent 6d376d34
This diff is collapsed.
This diff is collapsed.
query,trial,case,num_results,user_id,ra,apriori,plan,expand,string,db
3,0,,64,,,,,,,786.432
3,0,1,64,1,27.0,72.0,509.0,421.0,13537.0,55176.888
3,1,1,64,1,17.0,131.0,540.0,814.0,21165.0,23592.729
3,2,1,64,1,6.0,30.0,193.0,223.0,19531.0,12403.158
3,3,1,64,1,5.0,28.0,160.0,172.0,35694.0,12354.03
3,4,1,64,1,6.0,31.0,142.0,167.0,38728.0,13958.339
3,5,1,64,1,4.0,24.0,137.0,175.0,36325.0,15532.371
3,6,1,64,1,6.0,22.0,138.0,177.0,45940.0,12939.274
3,7,1,64,1,3.0,20.0,139.0,179.0,49298.0,20384.103
3,8,1,64,1,7.0,43.0,275.0,463.0,34605.0,18510.204
3,9,1,64,1,3.0,22.0,107.0,145.0,17353.0,12910.764
3,10,1,64,1,3.0,18.0,113.0,154.0,41199.0,12302.146
3,11,1,64,1,4.0,18.0,113.0,136.0,49514.0,13020.734
3,12,1,64,1,3.0,18.0,115.0,161.0,62451.0,12645.487
3,13,1,64,1,5.0,19.0,105.0,136.0,38478.0,13906.959
3,14,1,64,1,5.0,35.0,159.0,225.0,42986.0,17929.547
3,15,1,64,1,4.0,18.0,106.0,124.0,30813.0,12588.131
3,16,1,64,1,4.0,19.0,100.0,140.0,47161.0,14592.615
3,17,1,64,1,3.0,16.0,154.0,136.0,30228.0,21172.688
3,18,1,64,1,4.0,15.0,91.0,120.0,30727.0,12831.304
3,19,1,64,1,3.0,17.0,92.0,127.0,34580.0,14712.27
3,20,1,64,1,3.0,15.0,100.0,175.0,39324.0,12241.602
3,21,1,64,1,5.0,17.0,98.0,136.0,41612.0,12939.225
3,22,1,64,1,2.0,14.0,87.0,117.0,39812.0,12415.028
3,23,1,64,1,3.0,18.0,109.0,137.0,50308.0,15786.781
3,24,1,64,1,4.0,18.0,101.0,134.0,61164.0,13086.568
3,0,2,64,1,2.0,39.0,143.0,153.0,47113.0,12234.748
3,1,2,64,1,2.0,14.0,112.0,101.0,29364.0,12454.994
3,2,2,64,1,2.0,14.0,118.0,110.0,47056.0,12164.085
3,3,2,64,1,3.0,14.0,122.0,115.0,32469.0,21639.235
3,4,2,64,1,2.0,14.0,138.0,102.0,52501.0,12945.422
3,5,2,64,1,2.0,17.0,122.0,107.0,29149.0,12571.374
3,6,2,64,1,2.0,20.0,105.0,100.0,50080.0,12433.973
3,7,2,64,1,4.0,17.0,128.0,119.0,46668.0,13252.039
3,8,2,64,1,2.0,13.0,111.0,109.0,44209.0,16687.017
3,9,2,64,1,2.0,13.0,125.0,111.0,45820.0,12849.846
3,10,2,64,1,4.0,15.0,129.0,112.0,52381.0,49152.976
3,11,2,64,1,2.0,13.0,120.0,135.0,13266.0,12862.546
3,12,2,64,1,2.0,12.0,119.0,99.0,52089.0,14027.244
3,13,2,64,1,3.0,13.0,110.0,103.0,50148.0,13299.802
3,14,2,64,1,2.0,12.0,105.0,94.0,16665.0,26673.325
3,15,2,64,1,2.0,11.0,105.0,93.0,32806.0,13636.881
3,16,2,64,1,2.0,13.0,122.0,121.0,56362.0,18235.468
3,17,2,64,1,2.0,12.0,136.0,99.0,41161.0,12423.645
3,18,2,64,1,2.0,11.0,105.0,126.0,49881.0,12530.038
3,19,2,64,1,2.0,12.0,126.0,120.0,13549.0,12510.073
3,20,2,64,1,3.0,13.0,107.0,94.0,39194.0,12616.531
3,21,2,64,1,3.0,13.0,105.0,94.0,46139.0,12396.66
3,22,2,64,1,2.0,13.0,107.0,94.0,45948.0,13008.867
3,23,2,64,1,3.0,13.0,105.0,94.0,37668.0,12349.296
3,24,2,64,1,2.0,12.0,117.0,106.0,45643.0,12541.754
3,0,,59,,,,,,,33.064
3,0,1,59,2,3.0,15.0,92.0,122.0,36652.0,47893.712
3,1,1,59,2,2.0,10.0,91.0,111.0,12750.0,52531.943
3,2,1,59,2,2.0,39.0,85.0,105.0,11841.0,55295.561
3,3,1,59,2,2.0,11.0,124.0,140.0,12150.0,48967.825
3,4,1,59,2,3.0,14.0,120.0,107.0,19568.0,31722.709
3,5,1,59,2,2.0,11.0,86.0,161.0,14775.0,27274.8
3,6,1,59,2,3.0,13.0,91.0,229.0,12040.0,66587.048
3,7,1,59,2,2.0,11.0,82.0,107.0,11775.0,40419.243
3,8,1,59,2,2.0,11.0,83.0,109.0,24587.0,47547.346
3,9,1,59,2,2.0,11.0,82.0,111.0,13733.0,55825.943
3,10,1,59,2,2.0,11.0,91.0,113.0,12006.0,55398.815
3,11,1,59,2,2.0,10.0,80.0,110.0,11529.0,31055.867
3,12,1,59,2,2.0,14.0,83.0,115.0,24072.0,52007.026
3,13,1,59,2,3.0,14.0,93.0,176.0,11745.0,41867.294
3,14,1,59,2,2.0,11.0,82.0,102.0,13706.0,38772.484
3,15,1,59,2,2.0,12.0,96.0,150.0,11525.0,36488.115
3,16,1,59,2,2.0,10.0,81.0,102.0,12155.0,39993.704
3,17,1,59,2,2.0,13.0,91.0,146.0,11653.0,36475.924
3,18,1,59,2,2.0,10.0,80.0,101.0,11518.0,39777.596
3,19,1,59,2,2.0,10.0,101.0,121.0,11667.0,41069.623
3,20,1,59,2,3.0,13.0,84.0,101.0,11793.0,46715.125
3,21,1,59,2,2.0,10.0,80.0,102.0,11679.0,33787.161
3,22,1,59,2,3.0,12.0,84.0,101.0,12044.0,38678.42
3,23,1,59,2,1.0,10.0,83.0,104.0,11595.0,48509.164
3,24,1,59,2,9.0,21.0,83.0,101.0,11651.0,47742.523
3,0,2,59,2,2.0,10.0,104.0,99.0,11694.0,38534.001
3,1,2,59,2,3.0,16.0,110.0,99.0,11331.0,48503.144
3,2,2,59,2,2.0,9.0,101.0,90.0,11820.0,41617.356
3,3,2,59,2,2.0,10.0,100.0,89.0,11434.0,44933.922
3,4,2,59,2,2.0,10.0,100.0,93.0,11710.0,12557.208
3,5,2,59,2,2.0,10.0,100.0,98.0,11409.0,42449.297
3,6,2,59,2,3.0,14.0,120.0,97.0,11310.0,44542.855
3,7,2,59,2,2.0,10.0,99.0,89.0,11428.0,41395.051
3,8,2,59,2,2.0,12.0,132.0,116.0,11426.0,41949.252
3,9,2,59,2,2.0,11.0,102.0,100.0,11984.0,47236.943
3,10,2,59,2,5.0,19.0,118.0,111.0,11439.0,46088.369
3,11,2,59,2,2.0,12.0,103.0,118.0,11526.0,47843.004
3,12,2,59,2,2.0,10.0,102.0,92.0,11740.0,46583.019
3,13,2,59,2,3.0,12.0,104.0,91.0,11370.0,41554.866
3,14,2,59,2,2.0,9.0,106.0,92.0,11803.0,48193.309
3,15,2,59,2,2.0,9.0,101.0,89.0,11394.0,47055.819
3,16,2,59,2,2.0,9.0,98.0,88.0,11773.0,47442.045
3,17,2,59,2,2.0,9.0,135.0,110.0,11442.0,49653.952
3,18,2,59,2,3.0,12.0,106.0,94.0,11357.0,45908.423
3,19,2,59,2,2.0,10.0,110.0,97.0,11415.0,48238.151
3,20,2,59,2,2.0,10.0,100.0,90.0,11336.0,12516.232
3,21,2,59,2,2.0,10.0,105.0,98.0,11710.0,41987.27
3,22,2,59,2,2.0,12.0,118.0,130.0,11333.0,38972.874
3,23,2,59,2,2.0,13.0,141.0,93.0,11409.0,43907.567
3,24,2,59,2,1.0,10.0,98.0,88.0,11379.0,38256.827
\ No newline at end of file
......@@ -31,8 +31,10 @@ results <- rbind(
)
results <- rbind(
get_results(1, "results1.csv"),
get_results(2, "results2.csv")
get_results(2, "results2.csv"),
get_results(5, "results5.csv")
)
results <- get_results(5, "test.csv")
stats <- get_stats(results)
# Print plots to the screen
......@@ -45,7 +47,10 @@ rel1 <- box_db_query_relative(1)
abs2 <- box_db_query_absolute_log(2)
rel2 <- box_db_query_relative(2)
grid.arrange(abs1, abs2, rel1, rel2, diff_plan, stacked, nrow = 3, ncol = 2)
abs5 <- box_db_query_absolute_log(5)
rel5 <- box_db_query_relative(5)
grid.arrange(abs1, rel1, abs2, rel2, abs5, rel5, diff_plan, stacked, nrow = 4, ncol = 2)
# Save all graphs to individual tex files
save_half("planning_time_joins-2.tex", diff_plan_time)
......
......@@ -27,7 +27,7 @@ diff_plan_time <- function() {
# 2. Box plot of distribution of mean DB execution times of different user IDs
# between two cases across queries
box_db_query_absolute_log <- function(scale) {
ggplot(stats$means[stats$means$scale == scale,], aes(x = db, y = query, fill = case)) +
ggplot(results[results$scale == scale,], aes(x = db, y = query, fill = case)) +
geom_boxplot(outlier.size = 0.1) +
ggplot_theme +
scale_x_continuous(trans = pseudolog10_trans) +
......
......@@ -14,25 +14,26 @@ get_results <- function(scale, filename) {
df <- df[, c("scale", "query", "user_id", "case", "trial", "num_results", "ra", "apriori", "plan", "expand", "string", "db", "plan_and_db")]
df <- df[order(df$scale, df$query, df$user_id, df$case, df$trial), ]
remove_outliers <- function(x, na.rm = TRUE, ...) {
qnt <- quantile(x, probs=c(.25, .6), na.rm = na.rm, ...)
y <- x
y[x > qnt[2]] <- NA
y
}
add_new_column <- function(df) {
new <- remove_outliers(df$db)
return(cbind(new,df))
}
df_clean <- df %>%
group_by(scale, query, user_id, case) %>%
nest() %>%
mutate(data = map(data, add_new_column)) %>%
unnest(cols = c(data))
df <- df_clean[!is.na(df_clean$new),]
df <- select (df,-c(new))
# remove_outliers <- function(x, na.rm = TRUE, ...) {
# qnt <- quantile(x, probs=c(.1, .65), na.rm = na.rm, ...)
# y <- x
# y[x > qnt[2]] <- NA
# y[x < qnt[1]] <- NA
# y
# }
#
# add_new_column <- function(df) {
# new <- remove_outliers(df$db)
# return(cbind(new,df))
# }
#
# df_clean <- df %>%
# group_by(scale, query, user_id, case) %>%
# nest() %>%
# mutate(data = map(data, add_new_column)) %>%
# unnest(cols = c(data))
# df <- df_clean[!is.na(df_clean$new),]
# df <- select (df,-c(new))
return(df)
}
......@@ -66,8 +67,8 @@ get_stats <- function(results) {
}
# ------ Calculate Mean Time stats ------
get_means <- function() {
means <- ddply(results, .(scale, query, user_id, case), numcolwise(mean))
get_means <- function(agg_func) {
means <- ddply(results, .(scale, query, user_id, case), numcolwise(agg_func))
means <- means[, c("scale", "query", "user_id", "case", "ra", "apriori", "plan", "expand", "string", "db")]
means <- means[order(means$scale, means$query, means$user_id, means$case), ]
return(means)
......@@ -86,12 +87,15 @@ get_stats <- function(results) {
return(meansuseridquery)
}
means <- get_means()
means <- get_means(mean)
medians <- get_means(median)
variance <- get_means(var)
abs_diff <- get_absolute_difference(means)
rel_diff <- get_relative_difference(means)
meansuserid <- get_means_user_id(means)
meansuseridquery <- get_means_user_id_query(meansuserid)
medians <- merge_stats(medians, order(medians$scale, medians$query, medians$user_id, medians$case))
means <- merge_stats(means, order(means$scale, means$query, means$user_id, means$case))
meansuserid <- merge_stats(meansuserid, order(meansuserid$scale, meansuserid$query, meansuserid$case))
......@@ -99,6 +103,8 @@ get_stats <- function(results) {
abs_diff = abs_diff,
rel_diff = rel_diff,
means = means,
variance = variance,
medians = medians,
meansuserid = meansuserid,
meansuseridquery = meansuseridquery
))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment