Questions tagged [query-tuning]

123 questions
1
vote
1 answer

Possibilities of Query tuning in my case using SQL Server 2012

I have 2 tables called Sales and SalesDetails; SalesDetails has 90 million rows. When I want to retrieve all records for 1 year, it almost takes 15 minutes, and it's still not yet completed. I tried to retrieve records for 1 month, it took 1 minute…
Liam neesan
  • 2,282
  • 6
  • 33
  • 72
1
vote
2 answers

Error logging with MERGE query in Oracle 11

I am using Oracle 11 and I have millions of records in my table. I am using a MERGE statement to update records from source table to target table. At any moment while updating these millions of records, how can I log errors per record? For example:…
MiniSu
  • 566
  • 1
  • 6
  • 22
1
vote
1 answer

Tuning SQL 2005 database using SQL 2008 tools?

I have an assignment to tune a poorly performing query running on a SQL 2005 database. I have SQL 2008 management tools installed on my workstation. Can I use some of the new query tuning tools in 2008 like the data collector and system data…
Jim Evans
  • 6,285
  • 10
  • 37
  • 60
1
vote
1 answer

Query Tuning and rewrite - SQL Server

Could you help to optimize the below query to perform better? Can I reduce the cost? SELECT this_.id AS id1_20_0_, this_.version AS version2_20_0_, this_.domain AS domain4_20_0_, …
1
vote
1 answer

hive analyze query taking lot of time

In order to speed up ETL queries on large tables, we run many analyze queries on these tables and date columns in the evening. but these analyze queries on columns take lot of memory and time. we are using tez. is there any way to optimize analyze…
Kumar
  • 119
  • 10
1
vote
2 answers

selecting from a view is taking longer than 30+ minutes

I am working on making this view fast enough to fetch the result set in reasonable time which is at the moment taking more than 30+ minutes, going parallel and causing all sorts of pain with increased cpu time. I have identified the problem query…
Feivel
  • 111
  • 4
1
vote
2 answers

Expanded tree cache full error need to tune the query

Description: $enumValues will have sequence of strings that I have to look into $assetSubGroup will have a element value from XML (for loop) i.e string that I have to match in above maintained sequence If match is not, I have to hold few element…
1
vote
0 answers

Slow PostgreSQL query even after index scan

I am running below PostgreSQL query select * from (Select * from person where lastmodifieddate >= '2018-06-20' and lastmodifieddate <= '2018-06-25')p left join persondetail pd on p.personid=pd.personid left join personalert pa on…
YogeshR
  • 1,606
  • 2
  • 22
  • 43
1
vote
0 answers

Explain plan for mysql performance. Query taking more than 8hrs and still executing

I read various blogs and documents online but just wanted to know how i can optimize the query. I am unable to decide if we have to rewrite the query or add indexes in order to optimize. I tried adding indexes also on INDEX(DSR_BOOKED_BY,…
1
vote
1 answer

Explain plan in mysql performance using Using temporary; Using filesort ; Using index condition

I read various blogs and documents online but just wanted to know how i can optimize the query. I am unable to decide if we have to rewrite the query or add indexes in order to optimize. Adding create table structure also CREATE TABLE `dsr_table` ( …
1
vote
1 answer

SQL Server - Efficient generation of dates in a range

Using SQL Server 2016. I have a stored procedure that produces a list of options against a range of dates. Carriage options against days for clarity but unimportant to the specifics here. The first step in the stored procedure generates a list of…
Matthew Baker
  • 2,637
  • 4
  • 24
  • 49
1
vote
2 answers

Index partial values in Oracle

I am creating a composite index. create index I on TEST (A,B); And my query is like select * from TEST where A=:1 and B IS NOT NULL Above query will only return few rows ( < 10) but my leading colulmn "A" is not much unique and can return half…
Ajay Singh
  • 125
  • 1
  • 1
  • 11
1
vote
1 answer

Searching 13 million records using full text search with additional conditions

Performance issue while doing SQL Server full text search with additional conditions. (SQL Server 2012) I am trying to filter the data based on search filters list (table value parameter), which will return all the records for match filters and…
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
2 answers

MarkLogic: Understanding searchable and unsearchable queries?

I have the following expression: let $q1 := cts:element-range-query(xs:QName("ts:week"), ">=" ,xs:date("2009-04-25")) return cts:search(fn:doc(), $q1, "unfiltered") I did a xdmp:plan, and got to know that range indexes are being used and the…
Yash
  • 510
  • 2
  • 6
  • 14
1 2
3
8 9