Skip to main content

All Questions

Tagged with
-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 ...
user124's user avatar
  • 433
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 ...
JetRocket11's user avatar
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; *************************** ...
user124's user avatar
  • 433
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 ...
minhhungit's user avatar
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 ...
Mariana's user avatar
  • 359
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]/...
Ryan's user avatar
  • 23.3k
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, ...
Ora_as's user avatar
  • 1
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 ...
piezol's user avatar
  • 954
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 = ...
overexchange's user avatar
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 ...
Ora_as's user avatar
  • 1
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] ...
Achalesh's user avatar
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, ...
Gatsby's user avatar
  • 375
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 , ...
user1428798's user avatar
  • 1,546
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) ...
Atoli Gaming's user avatar
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 (...
Earthcoder's user avatar

15 30 50 per page
1 2 3
4
5
36