This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from urllib.parse import urlparse | |
| from sqlalchemy import create_engine, text | |
| from sqlalchemy.orm import sessionmaker | |
| from dotenv import load_dotenv | |
| import random | |
| load_dotenv() | |
| def safe_random_sample(x, n): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sqlcmd -S dbm-kyle-sqlsqerver.cfxxae8cilce.us-east-1.rds.amazonaws.com -U kylelf -P Vigil20! -Y 8000 -Q "SELECT TOP 1 qs.creation_time, qs.last_execution_time, qs.execution_count, st.text, qp.query_plan FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp ORDER BY qs.creation_time DESC" -X -p | |
| <ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.539" Build="15.0.4198.2"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT TOP 1 qs.creation_time, qs.last_execution_time, qs.execution_count, st.text, qp.query_plan FROM sys.dm_exec_query_stats AS qs CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp ORDER BY qs.creation_time DESC" StatementId="1" StatementCompId="1" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="0.0390951" StatementEstRows="1" SecurityPolicyApplied="false" StatementOptmLev |