Skip to main content

All Questions

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
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
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
683 views

Execution plan different on same db in two instance

I am struggling with a mysterious problem: I have a query in production that dropped his performance dramatically, taking from a few second to two minutes. By analyzing the execution plan, I found ...
Matt's user avatar
  • 9
2 votes
2 answers
414 views

How can I improve this oracle 11g plan selection without changing query?

I have a data re-population scheme for a set of oracle 11g database tables that entails: Drop and recreate all tables. Drop is like DROP TABLE TCA_SECURITY_DAY_BAR CASCADE CONSTRAINTS PURGE Load ...
user1338952's user avatar
  • 3,341
0 votes
0 answers
2k views

Teradata - Insert into table takes long time - problem with plan execution?

I want to insert data into the target table but unfortunately it takes too much time, even it is only around 800 000 records. I think that the problem is with the execution plan/bad indexes or ...
devwaprod's user avatar
2 votes
2 answers
74 views

Why is PostgreSQL 11 optimizer refusing best plan which would use an index w/ included column?

PostgreSQL 11 isn't smart enough to use indexes with included columns? CREATE INDEX organization_locations__org_id_is_headquarters__inc_location_id_ix ON organization_locations(org_id, ...
quickdraw's user avatar
  • 111
2 votes
2 answers
6k views

Cost of using OPTION (RECOMPILE) vs Joining to tables

Using: SQL Server 2016+ I've been looking to see if there is any way to evaluate how long it takes SQL Server to recompile the execution plan for a query. We have several stored procedures where we ...
Matthew Baker's user avatar
0 votes
3 answers
113 views

SQL Server 2012 Estimated Row Numbers Much Different than Actual

I have a query that cross joins two tables. TABLE_1 has 15,000 rows and TABLE_2 has 50,000 rows. A query very similar to this one has run in the past in roughly 10 minutes. Now it is running ...
OverflowingTheGlass's user avatar
1 vote
1 answer
51 views

SQL How to optimize insert to table from temporary table

I created procedure where dynamically collecting from various projects (Databases) some records into temporary table and from that temporary table I am inserting into table. With WHERE statement , but ...
BinaryTie's user avatar
  • 301
-2 votes
1 answer
109 views

Optimization SQL

I'm pretty new to SQL writing and trying to learn how to optimize my query. I saw the suggestion online are: explain plan and indexing.(I'm using Teradata) I have some questions: Teradata has "...
ADJ's user avatar
  • 102
1 vote
1 answer
254 views

Big difference in Estimated and Actual rows when using a local variable

This is my first post on Stackoverflow so I hope I'm correctly following all protocols! I'm struggling with a stored procedure in which I create a table variable and filling this table with an insert ...
Peter Kroezen's user avatar
3 votes
1 answer
90 views

Why does creating an unrelated index make my query faster?

I have a table: debts ( name text, inv_no integer, inv_type text, status text, ); I have a following select: SELECT COUNT(*) FROM debts WHERE name = '...' AND inv_no ...
Jecke's user avatar
  • 239
4 votes
4 answers
2k views

Does Oracle chose a default execution plan when parsing a prepared statement?

According to this Oracle documentation, I can assume that the Optimizer postpones the hard parse and it doesn't generate an execution plan until the first time a prepared statement is executed: "The ...
Vlad Mihalcea's user avatar
0 votes
0 answers
69 views

sql long running query requires optimization

Oracle query. The following query takes some time to execute: SELECT GCCOM_ACCOUNT_CONTRACT.ID_ACCOUNT_CONTRACT FROM GCCOM_ACCOUNT_CONTRACT, GCCOM_ACCOUNT_GROUP WHERE ...
IGNACIO CEMELI's user avatar

15 30 50 per page