sqlperformance

    1热度

    2回答

    说我有一个MySQL查询像这样: SELECT id, something, CASE colour WHEN 1 THEN 'not ripe' WHEN 2 THEN 'ripe' ELSE 'rotten' END AS 'ripeness' FROM fruit WHERE fruit_type = 'app

    0热度

    1回答

    我有以下查询,我想删除管理部门中的3名员工。 Delete from Employee_tbl where emp_Id = 123 and emp_dep = 'Admin'; Delete from Employee_tbl where emp_Id = 456 and emp_dep = 'Admin'; Delete from Employee_tbl where emp_Id = 7

    3热度

    3回答

    我有以下表结构: AuditUserMethods: +---------------+---------------+----------+ | ColumnName | DataType | Nullable | +---------------+---------------+----------+ | Id | INT | NOT NULL | | CreatedDate

    -3热度

    2回答

    我使用MS SQL Server 2012中: 这两个查询是: 1: with cte as ( <some code> ) delete p from table p join cte on p.id=cte.id and p.date>cte.date 2: with cte as ( <some code> ) delete p from table p join ct

    0热度

    1回答

    我想通过大量的变量选项来进行一些高级查询的自动化SQL分析。什么我希望做的是类似于以下 set statistics io on set statistics time on select * from MyTable set statistics time off set statistics io off --Somehow return the statistics for

    3热度

    2回答

    摘要 我计划存储在SQL Azure数据库与下面的模式牌照名单: 架构 CREATE TABLE [dbo].[events]( [id] [bigint] IDENTITY(1,1) NOT NULL, [dateTimeCreated] [datetime] NOT NULL, [registration] [varchar](14) NOT NULL ) ON

    1热度

    1回答

    我有一个数百万记录表格,其中定义了一个整数主键。 我也有“黑名单”中没有数以百万计的ID。它们存储在内存中(从磁盘上的文件读取)。 我必须选择不在黑名单中的记录,即所有记录的ID不在我的黑名单中。 我解决了这个问题,使用临时表(单列:ID)插入不需要的ID,然后选择其ID不在此表中的所有记录。 我最关心的是性能: 插入如此多的纪录临时表。 选择不在临时表中的项目。 编辑 在我使用的是临时表像这样的

    0热度

    1回答

    我有查询,需要搜索3个表中的数据。 公司表= 280K行 PostIndex表= 3.1k行 CompanyCategory = 5行 查询看起来是这样的: query = '' associations = [:post_index, :company_category] Company.includes(associations).references(associations).wher

    2热度

    1回答

    我正在运行MySql 5.6,并且我注意到,当我对服务器进行基准测试(在一段时间内并行执行几百个查询)时,m1.large aws实例的CPU利用率从未超过50% 。 我已在thread_cache变量设置为50和max_connections 500当我执行从壳下面的命令, 中mysqladmin -u根-ppassword -r -i 1个分机| grep的由Threads_created 我

    0热度

    2回答

    我有这样的SQL查询的SQL查询的性能: IF NOT EXISTS (SELECT TOP 1 RowId FROM dbo.Cache AS C WHERE StringSearched = @pcpnpi AND colName = 'pcpnpi' AND ModifiedAt > (SELECT ModifiedAt