Team Ai
Apppublic

Kalletlamadhav/sql-optimization-env

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
models.cpython-311.pyc31 linesDownload Raw Back to __pycache__
1�

2�w�i ���ddlmZmZddlmZmZmZmZddlm	Z	Gd�de3e	��ZGd�de��ZGd�d	e��Z
Gd4�de��ZGd�d
e��ZGd�de��ZGd�de��ZdS)�)�	BaseModel�Field)�Optional�List�Dict�Any)�Enumc�.�eZdZdZdZdZdZdZdZdZ	dZ5d	S)6�AntiPatternType�7N_PLUS_ONE�CARTESIAN_PRODUCT�
MISSING_INDEX�SELECT_STAR�LEADING_WILDCARD�
IMPLICIT_CAST�UNBOUNDED_AGGREGATION�NONEN)�__name__�8__module__�__qualname__rr
rrrrrr���9C:\open_env_sql_opt\sql-optimization-env\server\models.pyrrs9�������J�+��#�M��K�)��#�M�3���D�D�Drrc�v�eZdZUeed<eed<eed<eed<dZeeed<dZ	eeed<eed<dS)	�
ExecutionPlan�	operation�
rows_examined�
rows_returned�
cost_estimateN�using_index�missing_index_hint�explain_raw)9rrr�str�__annotations__�int�floatr rr!rrrrrst��������N�N�N�������������!%�K��#��%�%�%�(,����
�,�,�,������rrc��eZdZUeed<eed<eed<eed<eed<eed<eed<eed<eee	fed	<eed10<dZ11eeed<dZeeed
<dS)�SQLOptObservation�task_id�step_number�goal�12schema_ddl�
current_query�execution_plan�execution_time_ms�	row_count�db_stats�curriculum_levelN�anti_pattern_hint�
error_message)
rrrr#r$r%rr&rrr3rr4rrrr(r(s��������
�L�L�L�����13
�I�I�I��O�O�O�����!�!�!�!������N�N�N��3��8�n��������'+��x��}�+�+�+�#'�M�8�C�=�'�'�'�'�'rr(c�|�eZdZUeed<ejZeed<dZeed<e	e14���Zeeed<dZ
eed<dS)	�SQLOptAction�optimized_query�identified_pattern��explanation��default_factory�index_statements�schema_analysisN)rrrr#r$rrr8r:r�listr=rr>rrrr6r6,st�����������*9�*>���>�>�>��K�����"'�%��"=�"=�"=��d�3�i�=�=�=��O�S�����rr6c��eZdZUeed<eed<eed<eed<eed<eed<eed<eed<eed	<d15Zeeed<d16S)�SQLOptReward�total�
speedup_score�equivalence_score�
pattern_score�index_score�simplicity_score�	penalties�
speedup_ratio�
hack_detectedN�	hack_type)	rrrr&r$�boolrKrr#rrrrArA4s���������L�L�L���������������������������������#�I�x��}�#�#�#�#�#rrAc�j�eZdZUeed<eed<eed<eed<ee	���Z17eee
fed<dS)�18StepResult�observation�reward�
reward_detail�doner;�infoN)rrrr(r$r&rArLr�dictrSrr#rrrrrNrNAsa�������"�"�"�"��M�M�M�����19�J�J�J� �5��6�6�6�D�$�s�C�x�.�6�6�6�6�6rrNc��eZdZUeed<eed<eed<eed<eed<ee���Ze	e20ed<eed<eed	<d21S)�EnvironmentState�22episode_id�current_task_id�current_step�	max_stepsr2r;�episode_rewards�total_episodes�23is_runningN)rrrr#r$r%rr?r[rr&rLrrrrVrVIs���������O�O�O����������N�N�N�����#(�5��#>�#>�#>�O�T�%�[�>�>�>����������rrVN)�pydanticrr�typingrrrr�enumr	r#rrr(r6rArNrVrrr�<module>ras���&�%�%�%�%�%�%�%�,�,�,�,�,�,�,�,�,�,�,�,������������c�4���������I����(�(�(�(�(�	�(�(�(������9����24$�25$�26$�27$�28$�9�29$�30$�31$�7�7�7�7�7��7�7�7������y�����r