All Questions
49
questions
0
votes
1
answer
76
views
How to ensure use of an index?
I have the following query:
SELECT cp.ID_Case
FROM dbo.CaseParty cp (NOLOCK)
JOIN dbo.Client cli (NOLOCK) ON CASE
WHEN cli.ClientType = 'atty' AND cp.ID_ClientAttorney = cli.ID_Client THEN 1
...
0
votes
0
answers
97
views
Azure Managed Instance - Slow Index Delete
I have a large table in Azure SQL Managed Instance. The table has ~ 550 million rows and is ~ 250 gb in size. The table has a clustered index on a surrogate key which is auto generated by the system ...
0
votes
1
answer
810
views
NOT Equal(<>) in Oracle SQL is ignoring Index and NULL valued rows
I have one query where need to filter based on NOT Equal values in Oracle SQL. Can not use EQUAL to condition as the possible values fo the column in unknown.
Query:
SELECT * from employee where name &...
0
votes
1
answer
130
views
SQL Server 2022 : unique index with two columns not working correctly
I have a table with users with over 50000000 entries. I want to check for the presence of already registered users on the server and I execute this request.
SELECT *
FROM
(SELECT TOP (1000) *
...
1
vote
1
answer
2k
views
How to avoid performance degradation when run query with cast in where clause?
I have a table with 2 varchar columns (name and value)
and I have such a query:
select * from attribute
where name = 'width' and cast( value as integer) > 12
This query works but I suppose there ...
2
votes
1
answer
45
views
Statistics rapidly changing within transaction - fixing execution plan
A problem I'm facing (Oracle 11g):
I create a table, let's call it table_xyz, with index (not unique, no primary key).
I create package with procedure that will insert let's say 10 millions ofrecords ...
1
vote
2
answers
4k
views
How to improve Clustered Index scan to Clustered Index seek?
I have two tables
[dbo].[Employee](
[EmployeeID] [int] IDENTITY(1,1) NOT NULL,
[Title] [varchar](50) NULL,
[Role] [int] NULL,
[Status] [varchar](1) NULL)
[dbo].[Roles](
[id] [int] ...
0
votes
2
answers
2k
views
Postgres subqueries running extremely slow, Why?
I've found queries that are sometimes slow to respond and are looking at the execution (explain analyze) plan.
I think the joining part in the subquery is slow, but looking at the execution plan, I ...
0
votes
1
answer
99
views
When mysql updates a non-indexed column,why can use the primary key
MySQL version is 8.0.23
Create table and insert data
CREATE TABLE `test_update` (
`id` int NOT NULL ,
`column1` varchar(20) DEFAULT NULL,
`column2` varchar(20) DEFAULT NULL,
...
0
votes
3
answers
723
views
Indexing not working with column using range operations in oracle
I have created index on timestamp column for my table, but when I am querying and checking the explain plan in oracle it is doing the full table scan rather that range scan
Below is the DDL script for ...
0
votes
1
answer
1k
views
Explain analyze slower than actual query in postgres
I have the following query
select * from activity_feed where user_id in (select following_id from user_follow where follower_id=:user_id)
union
select * from activity_feed where project_id in (select ...
1
vote
1
answer
1k
views
Why is SQL Server choosing the "wrong" Index?
I have a Transaction table with about 200 million records, one primary key clustered on Id and 2 indexes:
IX_SiloId_ChangedTime_IncludeTime
IX_SiloId_Time_IncludeContent
I run these 2 statements ...
0
votes
1
answer
627
views
Postgresql: Seq Scan instead of Index Scan
I have following table:
create table if not exists inventory
(
expired_at timestamp(0),
-- ...
);
create index if not exists inventory_expired_at_index
on inventory (expired_at);
However ...
1
vote
2
answers
1k
views
What is SYS_OP_UNDESCEND and SYS_OP_DESCEND in Oracle Explain Plan?
I have an Oracle explain plan that looks like this:
Plan hash value: 2484140766
...
0
votes
0
answers
290
views
SQL Warning INSERT INTO %%bmk%%
I have warning on my execution plan:
insert [#TABLE] select *, %%bmk%% from [#TABLE]
<Warnings>
<MemoryGrantWarning GrantWarningKind="Excessive Grant" RequestedMemory="...