SqlServer创建各类索引脚本

示例脚本一

以下是一个创建各类索引的SQL脚本,包含详细注释说明。脚本涵盖了聚集索引(Clustered Index)、非聚集索引(Non-Clustered Index)、唯一索引(Unique Index)和全文索引(Full-Text Index)。

-- 创建聚集索引(Clustered Index)
-- 聚集索引将数据行按索引键的顺序存储在表中,每个表只能有一个聚集索引。
CREATE CLUSTERED INDEX IDX_Clustered_OrderDate
ON Orders (OrderDate ASC);
-- 示例说明:对"Orders"表的"OrderDate"列创建升序的聚集索引,适合按日期查询数据。

-- 创建非聚集索引(Non-Clustered Index)
-- 非聚集索引包含索引键和指向数据行的指针,不影响表中数据的存储顺序。
CREATE NONCLUSTERED INDEX IDX_NonClustered_CustomerName
ON Customers (CustomerName ASC);
-- 示例说明:对"Customers"表的"CustomerName"列创建非聚集索引,适合搜索特定客户。

-- 创建唯一索引(Unique Index)
-- 唯一索引强制列中的值唯一性,防止重复值。
CREATE UNIQUE INDEX IDX_Unique_Email
ON Users (Email ASC);
-- 示例说明:对"Users"表的"Email"列创建唯一索引,确保电子邮件地址的唯一性。

-- 创建复合索引(Composite Index)
-- 复合索引是针对多列创建的索引,优化多列组合的查询性能。
CREATE NONCLUSTERED INDEX IDX_Composite_FirstLastName
ON Employees (FirstName ASC, LastName ASC);
-- 示例说明:对"Employees"表的"FirstName"和"LastName"列创建复合索引,适合按名字和姓氏组合查询。

-- 创建全文索引(Full-Text Index)
-- 全文索引用于全文搜索,例如搜索包含某些单词或短语的文本。
-- 全文索引的
# ComfyUI Error Report ## Error Details - **Node Type:** Mix Color By Mask - **Exception Type:** RuntimeError - **Exception Message:** [enforce fail at alloc_cpu.cpp:114] data. DefaultCPUAllocator: not enough memory: you tried to allocate 144019814400 bytes. ## Stack Trace ``` File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 317, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 192, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui-main\MaskNodes.py", line 509, in mix mask = tensor2batch(tensor2mask(mask), image.size()) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui-main\MaskNodes.py", line 76, in tensor2batch t.repeat(bs[0], 1, 1, 1) ``` ## System Information - **ComfyUI Version:** v0.1.3-22-gd4aeefc2 - **Arguments:** F:\comfyui v1.4\ComfyUI-aki-v1.4\main.py --auto-launch --preview-method auto --disable-cuda-malloc - **OS:** nt - **Python Version:** 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] - **Embedded Python:** false - **PyTorch Version:** 2.3.1+cu121 ## Devices - **Name:** cuda:0 NVIDIA GeForce RTX 3070 : cudaMallocAsync - **Type:** cuda - **VRAM Total:** 8589279232 - **VRAM Free:** 3596957476 - **Torch VRAM Total:** 3791650816 - **Torch VRAM Free:** 10827556 ## Logs ``` 2025-10-23 09:36:37,550 - root - INFO - Total VRAM 8191 MB, total RAM 65457 MB 2025-10-23 09:36:37,550 - root - INFO - pytorch version: 2.3.1+cu121 2025-10-23 09:36:42,177 - root - INFO - xformers version: 0.0.27 2025-10-23 09:36:42,177 - root - INFO - Set vram state to: NORMAL_VRAM 2025-10-23 09:36:42,177 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3070 : cudaMallocAsync 2025-10-23 09:36:42,627 - root - INFO - Using xformers cross attention 2025-10-23 09:36:44,974 - root - INFO - [Prompt Server] web root: F:\comfyui v1.4\ComfyUI-aki-v1.4\web 2025-10-23 09:36:47,303 - root - WARNING - Traceback (most recent call last): File "F:\comfyui v1.4\ComfyUI-aki-v1.4\nodes.py", line 1993, in load_custom_node module_spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 879, in exec_module File "<frozen importlib._bootstrap_external>", line 1016, in get_code File "<frozen importlib._bootstrap_external>", line 1073, in get_data FileNotFoundError: [Errno 2] No such file or directory: 'F:\\comfyui v1.4\\ComfyUI-aki-v1.4\\custom_nodes\\ComfyUI-Frame-Interpolation\\__init__.py' 2025-10-23 09:36:47,303 - root - WARNING - Cannot import F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Frame-Interpolation module for custom nodes: [Errno 2] No such file or directory: 'F:\\comfyui v1.4\\ComfyUI-aki-v1.4\\custom_nodes\\ComfyUI-Frame-Interpolation\\__init__.py' 2025-10-23 09:36:51,657 - root - WARNING - Traceback (most recent call last): File "F:\comfyui v1.4\ComfyUI-aki-v1.4\nodes.py", line 1993, in load_custom_node module_spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 879, in exec_module File "<frozen importlib._bootstrap_external>", line 1016, in get_code File "<frozen importlib._bootstrap_external>", line 1073, in get_data FileNotFoundError: [Errno 2] No such file or directory: 'F:\\comfyui v1.4\\ComfyUI-aki-v1.4\\custom_nodes\\ComfyUI-JakeUpgrade\\__init__.py' 2025-10-23 09:36:51,657 - root - WARNING - Cannot import F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-JakeUpgrade module for custom nodes: [Errno 2] No such file or directory: 'F:\\comfyui v1.4\\ComfyUI-aki-v1.4\\custom_nodes\\ComfyUI-JakeUpgrade\\__init__.py' 2025-10-23 09:36:51,687 - root - INFO - Total VRAM 8191 MB, total RAM 65457 MB 2025-10-23 09:36:51,687 - root - INFO - pytorch version: 2.3.1+cu121 2025-10-23 09:36:51,687 - root - INFO - xformers version: 0.0.27 2025-10-23 09:36:51,687 - root - INFO - Set vram state to: NORMAL_VRAM 2025-10-23 09:36:51,687 - root - INFO - Device: cuda:0 NVIDIA GeForce RTX 3070 : cudaMallocAsync 2025-10-23 09:37:03,093 - root - WARNING - Traceback (most recent call last): File "F:\comfyui v1.4\ComfyUI-aki-v1.4\nodes.py", line 1993, in load_custom_node module_spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 879, in exec_module File "<frozen importlib._bootstrap_external>", line 1016, in get_code File "<frozen importlib._bootstrap_external>", line 1073, in get_data FileNotFoundError: [Errno 2] No such file or directory: 'F:\\comfyui v1.4\\ComfyUI-aki-v1.4\\custom_nodes\\masquerade-nodes-comfyui\\__init__.py' 2025-10-23 09:37:03,093 - root - WARNING - Cannot import F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui module for custom nodes: [Errno 2] No such file or directory: 'F:\\comfyui v1.4\\ComfyUI-aki-v1.4\\custom_nodes\\masquerade-nodes-comfyui\\__init__.py' 2025-10-23 09:37:03,166 - root - INFO - Import times for custom nodes: 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\AIGODLIKE-ComfyUI-Translation 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\websocket_image_save.py 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ControlNet-LLLite-ComfyUI 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\FreeU_Advanced 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_TiledKSampler 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\stability-ComfyUI-nodes 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds (IMPORT FAILED): F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-JakeUpgrade 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-WD14-Tagger 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds (IMPORT FAILED): F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui-main 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_experiments 2025-10-23 09:37:03,166 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\PowerNoiseSuite 2025-10-23 09:37:03,167 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\images-grid-comfy-plugin 2025-10-23 09:37:03,167 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_UltimateSDUpscale 2025-10-23 09:37:03,167 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Custom-Scripts 2025-10-23 09:37:03,167 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\Derfuu_ComfyUI_ModdedNodes 2025-10-23 09:37:03,167 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Advanced-ControlNet 2025-10-23 09:37:03,167 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Frame-Interpolation-main 2025-10-23 09:37:03,167 - root - INFO - 0.0 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\efficiency-nodes-comfyui 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\rgthree-comfy 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_IPAdapter_plus 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-KJNodes 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-AnimateDiff-Evolved 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_Comfyroll_CustomNodes 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Inspire-Pack 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_controlnet_aux 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui-workspace-manager 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Crystools 2025-10-23 09:37:03,167 - root - INFO - 0.1 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-VideoHelperSuite 2025-10-23 09:37:03,168 - root - INFO - 0.3 seconds (IMPORT FAILED): F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Frame-Interpolation 2025-10-23 09:37:03,168 - root - INFO - 0.4 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Manager 2025-10-23 09:37:03,168 - root - INFO - 0.5 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Marigold 2025-10-23 09:37:03,168 - root - INFO - 0.5 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_segment_anything 2025-10-23 09:37:03,168 - root - INFO - 1.4 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_FizzNodes 2025-10-23 09:37:03,168 - root - INFO - 4.2 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI-Impact-Pack 2025-10-23 09:37:03,168 - root - INFO - 7.9 seconds: F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\ComfyUI_Custom_Nodes_AlekPet 2025-10-23 09:37:03,168 - root - INFO - 2025-10-23 09:37:03,189 - root - INFO - Starting server 2025-10-23 09:37:03,189 - root - INFO - To see the GUI go to: http://127.0.0.1:8188 2025-10-23 09:48:57,444 - root - INFO - got prompt 2025-10-23 09:48:57,639 - root - INFO - model weight dtype torch.float16, manual cast: None 2025-10-23 09:48:57,754 - root - INFO - model_type EPS 2025-10-23 09:48:58,270 - root - INFO - Using xformers attention in VAE 2025-10-23 09:48:58,272 - root - INFO - Using xformers attention in VAE 2025-10-23 09:48:58,906 - root - INFO - Requested to load SD1ClipModel 2025-10-23 09:48:58,906 - root - INFO - Loading 1 new model 2025-10-23 09:48:58,972 - root - INFO - loaded completely 0.0 235.84423828125 True 2025-10-23 09:48:59,356 - comfyui_segment_anything - WARNING - using extra model: F:\comfyui v1.4\ComfyUI-aki-v1.4\models\sams\sam_vit_h_4b8939.pth 2025-10-23 10:05:36,264 - root - ERROR - !!! Exception during processing !!! The shape of the mask [242, 960, 540, 3] at index 0 does not match the shape of the indexed tensor [287, 960, 540, 3] at index 0 2025-10-23 10:05:36,274 - root - ERROR - Traceback (most recent call last): File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 317, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 192, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\comfyui_controlnet_aux\node_wrappers\inpaint.py", line 19, in preprocess image[mask > 0.5] = -1.0 # set as masked pixel IndexError: The shape of the mask [242, 960, 540, 3] at index 0 does not match the shape of the indexed tensor [287, 960, 540, 3] at index 0 2025-10-23 10:05:36,276 - root - INFO - Prompt executed in 998.77 seconds 2025-10-23 11:41:16,176 - root - INFO - got prompt 2025-10-23 11:41:16,539 - root - INFO - Requested to load SD1ClipModel 2025-10-23 11:41:16,539 - root - INFO - Loading 1 new model 2025-10-23 11:41:19,879 - root - ERROR - !!! Exception during processing !!! [enforce fail at alloc_cpu.cpp:114] data. DefaultCPUAllocator: not enough memory: you tried to allocate 144019814400 bytes. 2025-10-23 11:41:19,912 - root - ERROR - Traceback (most recent call last): File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 317, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 192, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui-main\MaskNodes.py", line 509, in mix mask = tensor2batch(tensor2mask(mask), image.size()) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui-main\MaskNodes.py", line 76, in tensor2batch t.repeat(bs[0], 1, 1, 1) RuntimeError: [enforce fail at alloc_cpu.cpp:114] data. DefaultCPUAllocator: not enough memory: you tried to allocate 144019814400 bytes. 2025-10-23 11:41:19,913 - root - INFO - Prompt executed in 3.60 seconds 2025-10-23 11:44:36,321 - root - INFO - got prompt 2025-10-23 11:44:36,664 - root - INFO - Requested to load SD1ClipModel 2025-10-23 11:44:36,664 - root - INFO - Loading 1 new model 2025-10-23 11:44:38,174 - root - ERROR - !!! Exception during processing !!! [enforce fail at alloc_cpu.cpp:114] data. DefaultCPUAllocator: not enough memory: you tried to allocate 144019814400 bytes. 2025-10-23 11:44:38,175 - root - ERROR - Traceback (most recent call last): File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 317, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 192, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui-main\MaskNodes.py", line 509, in mix mask = tensor2batch(tensor2mask(mask), image.size()) File "F:\comfyui v1.4\ComfyUI-aki-v1.4\custom_nodes\masquerade-nodes-comfyui-main\MaskNodes.py", line 76, in tensor2batch t.repeat(bs[0], 1, 1, 1) RuntimeError: [enforce fail at alloc_cpu.cpp:114] data. DefaultCPUAllocator: not enough memory: you tried to allocate 144019814400 bytes. 2025-10-23 11:44:38,176 - root - INFO - Prompt executed in 1.79 seconds ``` ## Attached Workflow Please make sure that workflow does not contain any sensitive information such as API keys or passwords. ``` Workflow too large. Please manually upload the workflow from local file system. ``` ## Additional Context (Please add any additional context or steps to reproduce the error here)
10-24
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值