All Questions
Tagged with sql sql-execution-plan
535
questions
-1
votes
1
answer
33
views
How can I optimize DB query?
My db query is taking 5 seconds instead of <1 second earlier and the culprit query is :
explain extended
select A,B,C
from table flow
where
(status in ('X' , 'Y' , 'Z'))
and priority=1
and ...
0
votes
1
answer
570
views
SQL Query Execution Plan and Performance difference between 2 servers but query is same
Problem I am trying to solve is a query that on one server executes in 1 second but on another server it takes 10-20 seconds. Server one is a nightly replication of server 2 so pretty much everything ...
1
vote
0
answers
82
views
Why mysql is not using index on join?
I have the two tables named A and B. My query for explain SQL is:
explain select * from A k join P p1 on p1.aggregate_id=k.aggregate_id where p1.start=1 and p1.id= 123 \G;
*************************** ...
0
votes
1
answer
319
views
Stored procedure with table value parameter but ad-hoc?
I have a stored procedure like this:
CREATE PROCEDURE [dbo].[GetInventoryData]
@supplierId UNIQUEIDENTIFIER,
@numbers dbo.ListNumbers READONLY,
@locations dbo.ListLocations READONLY
AS
...
2
votes
1
answer
999
views
oracle json_value vs. json_table explain query plan
I have a query that it's been written a while ago. Basically a Materialized View that uses json_table function.
Recently since we moved to Oracle 19c that MV sometimes works and other times doesn't.
I ...
1
vote
1
answer
299
views
Why would LIMIT 2 queries work but LIMIT 1 always times out?
I'm using this public Postgres DB of NEAR protocol: https://github.com/near/near-indexer-for-explorer#shared-public-access
postgres://public_readonly:[email protected]/...
0
votes
1
answer
217
views
Optimize a query with IN() clauses oracle
Here I have a query like below:
SELECT /*+ USE_NL_WITH_INDEX(D) */ N.MARCHE,N.NLBIX,D.NUORD,D.NUCON, 0 NUBI2, N.COINF, D.COINL, D.COINA, D.COINV, N.COINN, D.COINC, D.NUCPT, D.COINI, N.COINK, N.CNACT, ...
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 ...
3
votes
2
answers
446
views
Why INSERT query is 3-4 times slower than SELECT?
Application talks to YugabyteDB instance with YCQL driver(Gocql).
We have below two queries (for example):
SELECT col2,
col3,
col4,
col5
FROM table1
WHERE primarykeycol = ...
0
votes
2
answers
189
views
Read execution plan in Oracle
my question is why there is the full access in the option however I create two index for LIGPOR and DATRAI tables ??
and if there is any one can help me to clearly read the long execution plan in sql ...
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] ...
1
vote
2
answers
474
views
Optimize SQL update query
I have an update which takes a lot of time to finish. 10 millions of rows need to be updated. The execution ended after 6 hours.
This is the query :
update A
set a_top = 'N'
where (a_toto, a_num, ...
0
votes
1
answer
31
views
optimise query postgressql
I have a long query on my database:
explain
SELECT DISTINCT C.* ,
F.vp_booking_id ,
F.provider_id ,
F.campaign_code ,
F.external_key ,
F.total_price ,
...
0
votes
0
answers
190
views
Why does a simple left join need a sort in the execution plan?
I have simple left join query like this
select
o.orderreference,
c.FirstName + ' ' + c.LastName as Customer,
c.phone as CustomerPhoneNumber,
case when(isjson(c.metafields) > 0) ...
0
votes
1
answer
357
views
Select count Distinct Slow MSSQL
Hello I got a simple query here but its slow as hell, takes around 40sec to get data back, I tried different SQL but still can't seem to make it work, any suggestions would be grateful
select
count (...