From 892bc1d595affe77cabd1e51a861eae64084fe4c Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Fri, 13 Jun 2025 09:00:22 -0500 Subject: [PATCH 1/3] Update qprof-ui.ipynb Added a new tab for dc_dile_reads --- project/ui/qprof-ui.ipynb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/project/ui/qprof-ui.ipynb b/project/ui/qprof-ui.ipynb index e5a1172e..12cd76f4 100644 --- a/project/ui/qprof-ui.ipynb +++ b/project/ui/qprof-ui.ipynb @@ -422,6 +422,7 @@ " button_other_info.disabled = True\n", " table_1.clear_output(wait=True)\n", " table_2.clear_output(wait=True)\n", + " table_3.clear_output(wait=True)\n", " try:\n", " transaction_statement_list = qprof.transactions\n", " logging.info(f'[Query Profile Tree Page] The list of transaction and statement ids are: {transaction_statement_list}')\n", @@ -441,25 +442,36 @@ " FROM dc_optimizer_events\n", " WHERE {where_clause};\n", " \"\"\"\n", + " query_3 = f\"\"\"\n", + " SELECT *\n", + " FROM dc_file_reads\n", + " WHERE {where_clause};\n", + " \"\"\"\n", " logging.info(f'[Query Profile Tree Page] Trying to get the DC SLOW EVENTS table')\n", " res_1 = vp.vDataFrame(f\"\"\"{query}\"\"\")\n", " res_2 = vp.vDataFrame(f\"\"\"{query_2}\"\"\")\n", + " res_3 = vp.vDataFrame(f\"\"\"{query_3}\"\"\")\n", " with table_1:\n", " res_1.idisplay()\n", " with table_2:\n", " res_2.idisplay()\n", + " with table_3:\n", + " res_3.idisplay()\n", " except Exception as e:\n", " with table_1:\n", " display(widgets.HTML(f\"

The following error occured:

{e}

\"))\n", " with table_2:\n", " display(widgets.HTML(f\"

The following error occured:

{e}

\"))\n", + " with table_3:\n", + " display(widgets.HTML(f\"

The following error occured:

{e}

\"))\n", " button_other_info.disabled = False\n", " \n", "table_1 = widgets.Output()\n", "table_2 = widgets.Output()\n", + "table_3 = widgets.Output()\n", "tables = widgets.Tab()\n", - "tables.children = [table_1, table_2]\n", - "tables.titles = [\"Slow Events\", \"Optimizer Events\"]\n", + "tables.children = [table_1, table_2, table_3]\n", + "tables.titles = [\"Slow Events\", \"Optimizer Events\", \"File Reads\"]\n", "other_info = widgets.VBox([button_other_info, tables])\n", "\n", "button_other_info.on_click(on_button_clicked_other_info)\n", From b56faa31507ee3110a590c797d83e3b28764d413 Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Mon, 16 Jun 2025 14:49:27 -0500 Subject: [PATCH 2/3] addressed comments --- project/ui/qprof-ui.ipynb | 65 +++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/project/ui/qprof-ui.ipynb b/project/ui/qprof-ui.ipynb index 12cd76f4..629864be 100644 --- a/project/ui/qprof-ui.ipynb +++ b/project/ui/qprof-ui.ipynb @@ -420,16 +420,21 @@ "\n", "def on_button_clicked_other_info(b):\n", " button_other_info.disabled = True\n", - " table_1.clear_output(wait=True)\n", - " table_2.clear_output(wait=True)\n", - " table_3.clear_output(wait=True)\n", + " table_slow_events.clear_output(wait=True)\n", + " table_optimizer_events.clear_output(wait=True)\n", + " table_file_reads.clear_output(wait=True)\n", + " \n", " try:\n", " transaction_statement_list = qprof.transactions\n", " logging.info(f'[Query Profile Tree Page] The list of transaction and statement ids are: {transaction_statement_list}')\n", - " # Construct the WHERE clause dynamically\n", " where_clause = \" OR \".join([f\"(transaction_id = {elem[0]} AND statement_id = {elem[1]})\" for elem in transaction_statement_list])\n", - " \n", - " # Construct the query\n", + " except Exception as e:\n", + " with table_slow_events:\n", + " display(widgets.HTML(f\"

The following error occurred while preparing the WHERE clause:

{e}

\"))\n", + " button_other_info.disabled = False\n", + " return\n", + "\n", + " try:\n", " query = f\"\"\"\n", " SELECT transaction_id, statement_id, node_name, event_description, time, duration_us/1000000 AS duration_sec\n", " FROM dc_slow_events\n", @@ -437,40 +442,48 @@ " ORDER BY duration_sec DESC\n", " LIMIT 500;\n", " \"\"\"\n", + " logging.info(f'[Query Profile Tree Page] Trying to get the DC SLOW EVENTS table')\n", + " res_slow_events = vp.vDataFrame(f\"\"\"{query}\"\"\")\n", + " with table_slow_events:\n", + " res_slow_events.idisplay()\n", + " except Exception as e:\n", + " with table_slow_events:\n", + " display(widgets.HTML(f\"

The following error occurred while loading DC SLOW EVENTS:

{e}

\"))\n", + "\n", + " try:\n", " query_2 = f\"\"\"\n", " SELECT *\n", " FROM dc_optimizer_events\n", " WHERE {where_clause};\n", " \"\"\"\n", + " res_optimizer_events = vp.vDataFrame(f\"\"\"{query_2}\"\"\")\n", + " with table_optimizer_events:\n", + " res_optimizer_events.idisplay()\n", + " except Exception as e:\n", + " with table_optimizer_events:\n", + " display(widgets.HTML(f\"

The following error occurred while loading DC OPTIMIZER EVENTS:

{e}

\"))\n", + "\n", + " try:\n", " query_3 = f\"\"\"\n", " SELECT *\n", " FROM dc_file_reads\n", " WHERE {where_clause};\n", " \"\"\"\n", - " logging.info(f'[Query Profile Tree Page] Trying to get the DC SLOW EVENTS table')\n", - " res_1 = vp.vDataFrame(f\"\"\"{query}\"\"\")\n", - " res_2 = vp.vDataFrame(f\"\"\"{query_2}\"\"\")\n", - " res_3 = vp.vDataFrame(f\"\"\"{query_3}\"\"\")\n", - " with table_1:\n", - " res_1.idisplay()\n", - " with table_2:\n", - " res_2.idisplay()\n", - " with table_3:\n", - " res_3.idisplay()\n", + " res_file_reads = vp.vDataFrame(f\"\"\"{query_3}\"\"\")\n", + " with table_file_reads:\n", + " res_file_reads.idisplay()\n", " except Exception as e:\n", - " with table_1:\n", - " display(widgets.HTML(f\"

The following error occured:

{e}

\"))\n", - " with table_2:\n", - " display(widgets.HTML(f\"

The following error occured:

{e}

\"))\n", - " with table_3:\n", - " display(widgets.HTML(f\"

The following error occured:

{e}

\"))\n", + " with table_file_reads:\n", + " display(widgets.HTML(f\"

The following error occurred while loading DC FILE READS:

{e}

\"))\n", + "\n", " button_other_info.disabled = False\n", + "\n", " \n", - "table_1 = widgets.Output()\n", - "table_2 = widgets.Output()\n", - "table_3 = widgets.Output()\n", + "table_slow_events = widgets.Output()\n", + "table_optimizer_events = widgets.Output()\n", + "table_file_reads = widgets.Output()\n", "tables = widgets.Tab()\n", - "tables.children = [table_1, table_2, table_3]\n", + "tables.children = [table_slow_events, table_optimizer_events, table_file_reads]\n", "tables.titles = [\"Slow Events\", \"Optimizer Events\", \"File Reads\"]\n", "other_info = widgets.VBox([button_other_info, tables])\n", "\n", From 06824e9c785d8a8bc4517d69b4805d9dfbcb697f Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Tue, 17 Jun 2025 01:10:43 -0500 Subject: [PATCH 3/3] Update qprof-ui.ipynb --- project/ui/qprof-ui.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/project/ui/qprof-ui.ipynb b/project/ui/qprof-ui.ipynb index 629864be..c8497090 100644 --- a/project/ui/qprof-ui.ipynb +++ b/project/ui/qprof-ui.ipynb @@ -451,12 +451,12 @@ " display(widgets.HTML(f\"

The following error occurred while loading DC SLOW EVENTS:

{e}

\"))\n", "\n", " try:\n", - " query_2 = f\"\"\"\n", + " query = f\"\"\"\n", " SELECT *\n", " FROM dc_optimizer_events\n", " WHERE {where_clause};\n", " \"\"\"\n", - " res_optimizer_events = vp.vDataFrame(f\"\"\"{query_2}\"\"\")\n", + " res_optimizer_events = vp.vDataFrame(f\"\"\"{query}\"\"\")\n", " with table_optimizer_events:\n", " res_optimizer_events.idisplay()\n", " except Exception as e:\n", @@ -464,12 +464,12 @@ " display(widgets.HTML(f\"

The following error occurred while loading DC OPTIMIZER EVENTS:

{e}

\"))\n", "\n", " try:\n", - " query_3 = f\"\"\"\n", + " query = f\"\"\"\n", " SELECT *\n", " FROM dc_file_reads\n", " WHERE {where_clause};\n", " \"\"\"\n", - " res_file_reads = vp.vDataFrame(f\"\"\"{query_3}\"\"\")\n", + " res_file_reads = vp.vDataFrame(f\"\"\"{query}\"\"\")\n", " with table_file_reads:\n", " res_file_reads.idisplay()\n", " except Exception as e:\n",