Questions tagged [sql-tuning]

SQL tuning commonly involves finding more efficient ways to process the same workload. It is possible to change the execution plan of the statement without altering the functionality to reduce the resource consumption.

328 questions
1
vote
0 answers

Filtering SQL Server View for better performance

Is there a performance difference executing the two views? If audit contains millions of records, is there a performance gain by filtering the data inside the view or using the where statement outside the view? select * from vwTestPerformance where…
Jim
  • 11
  • 4
1
vote
0 answers

SQL Server Fix Correlated Sub-Queries for Better Performance?

SQL Server 2014 I am trying to learn better SQL code practices to improve performance. I am inheriting some old code, and wanted to get an idea of how someone who actually knows what they're doing would improve it. I have tried to shorten the code…
Gemini
  • 109
  • 2
  • 15
1
vote
1 answer

sql fine tuning

In a Table, I need to combine 2 records into one record, based on columns (in this case column 1.WORK_ORDER_NUM, 2.ESN 3.PLANT 4. REMD_PART_NUM 5. REMD_PART_SERIAL). If these 5 columns are equal then I have to use Aggregate function in…
1
vote
0 answers

ORACLE paganiation with out sort field

I have a view, which doesn't have any unique column to determine the sort. View is a union all of two large tables. I need paganiation support with out sort. I did some research on that, came to know paganiation will fall fail if we don't use…
1
vote
2 answers

SQL Developer SQL Tuning Advisor not all variables bound

I'm trying to use the SQL tuning advisor with SQL Developer (versions 4.1.3.20 and 17.2.0.188). Queries using more than one instance of a bind variable, for example: select * from dual where :one = :one; are causing an error in the SQL Tuning…
hmqcnoesy
  • 4,165
  • 3
  • 31
  • 47
1
vote
2 answers

Performance tuning on filter data from large data set in sql server

I want to fix some performance issue with the following query. Tbl_A has 65 million rows Tbl_B has 2 rows I need to filter Tbl_A with the values of Tbl_b SELECT COUNT(*) FROM Tbl_A R1 WITH (NOLOCK) INNER JOIN Tbl_B PBD ON…
vignesh
  • 1,414
  • 5
  • 19
  • 38
1
vote
2 answers

Sql tuning advisor(accepting profile)

I have created sql tuning task for some query and executed it.After generating report,It recommends me to run the following command: execute dbms_sqltune.accept_sql_profile(task_name => 'tuning_task_name', …
kupa
  • 1,861
  • 5
  • 25
  • 41
1
vote
2 answers

where isnull (DateX, DateY) >= getdate()

Could anyone let me know the ways to improve the performance of the SQL below? select A, B from T_XXX where isnull(DateX, DateY) >= getdate() No index on either DateX or DateY. Currently No info about the proportion of NULL and non-NULL values…
yobioo
  • 79
  • 11
1
vote
0 answers

SQL Statement - CPU Usage - hard parsing

I was going through ADDM Reports in Oracle instance of my Project, and I found a SQL Statement appearing in ADDM snapshot consistently, below is one of the recommendations from report by Oracle: Rationale The SQL spent only 0% of its database…
M W
  • 13
  • 4
1
vote
1 answer

Is it possible to skip the particular SQL statement from auto sql tuning advisor job

I am facing an ORA:7445 issue with auto sql tuning advisor. Auto sql tuning advisor keeps failing with ORA:7445 while it's tries to tune a particular SQL. Is there any way to skip this sql statement from auto sql tuning advisor job?
1
vote
0 answers

Select query taking lot of time to execute

I have this query in my application SELECT /*+ parallel (4) */ a.orgkey AS cifid, a.strfield19 AS old_cif_id, a.cust_first_name, a.cust_middle_name, a.cust_last_name, …
Vishal5364
  • 293
  • 1
  • 4
  • 21
1
vote
0 answers

SQL Server HEAP Tables WITH Clustered Index , how is this possible?

I have a database that shows a few tables as HEAP, even since I am sure all of them have Clustered indexes and some even have a few Non-Clustered indexes, since a long time ago. my understanding for HEAP table is : "A heap is a table without a…
1
vote
0 answers

Sql Server strange execution plan choices

I have a query on sql server 2012 sp3 which is built dynamically through an application. I have noticed a case where it runs slow due to insufficient execution plan and I am trying to figure out the problem. In this case the query that is being…
1
vote
2 answers

FULLTEXT index takes longer to execute

The following query takes 1.1s to execute, the EXPLAIN shows the use of a FULLTEXT index: SELECT SQL_NO_CACHE COUNT(*) FROM e_entity WHERE meta_oid=336799 AND MATCH(sIndex07) AGAINST ("#UPR-1393#" IN NATURAL LANGUAGE MODE) EXPLAIN: id:…
Rafael
  • 1,099
  • 5
  • 23
  • 47
1
vote
2 answers

MySQL Slow query for 'COUNT'

The following query takes 0.7s on a 2.5Ghz dual core Windows Server 2008 R2 Enterprise when run over a 4.5Gb MySql database. sIndex10 is a varchar(1024) column type: SELECT COUNT(*) FROM e_entity WHERE meta_oid=336799 AND sIndex10 = '' An EXPLAIN…
Rafael
  • 1,099
  • 5
  • 23
  • 47