Skip to content

Commit

Permalink
Fixed Defaults and query retrival
Browse files Browse the repository at this point in the history
Fixed detault warmpup time to 60
Adjusted query that retrives stats on executed queries.
  • Loading branch information
altmannmarcelo committed Mar 28, 2024
1 parent f9bb1db commit 00b09e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions readyset_proxysql_scheduler.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ readyset_password = 'root'
readyset_host = '127.0.0.1'
readyset_port = 3307
source_hostgroup = 11
readyset_hostgroup = 12
warmup_time = 20
readyset_hostgroup = 99
warmup_time = 60
lock_file = '/tmp/readyset_scheduler.lock'
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ fn main() {
queries::find_queries_to_cache(&mut proxysql_conn, &config);

for (digest_text, digest, schema) in rows {
let digest_text = queries::replace_placeholders(&digest_text);
messages::print_info(format!("Going to test query support for {}", digest_text).as_str());
let supported =
queries::check_readyset_query_support(&mut readyset_conn, &digest_text, &schema);
Expand Down
10 changes: 9 additions & 1 deletion src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,21 @@ pub fn find_queries_to_cache(
AND s.schemaname NOT IN ('sys', 'information_schema', 'performance_schema', 'mysql')
AND s.digest_text LIKE 'SELECT%FROM%'
AND digest_text NOT LIKE '%?=?%'
AND q.rule_id IS NULL",
AND s.sum_rows_sent > 0
AND q.rule_id IS NULL
ORDER BY s.sum_rows_sent DESC",
config.source_hostgroup, config.readyset_user
))
.expect("Failed to query proxysql_conn");
rows
}

pub fn replace_placeholders(query: &String) -> String {
// date placeholder
let query = query.replace("?-?-?", "?");
query
}

pub fn check_readyset_query_support(
conn: &mut PooledConn,
digest_text: &String,
Expand Down

0 comments on commit 00b09e8

Please sign in to comment.