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
0
votes
1 answer

teradata - volatile table

2 Questions I populated a volatile table with couple of million rows and am running a query via bteq on a Solaris Client ( so it runs regardless of my workstation connection) . Now If I see the run time explain stuck at some step , I want to abort…
user1874594
  • 2,277
  • 1
  • 25
  • 49
0
votes
1 answer

Teradata SQL Derived table data redistribution

This is once again a a question for SQL Pundits. I can create derived tables in Teradata using these approaches - With ( __,__) (select statement ) alias query -- select ____ from a , ( select statement ) b < Join condition ) I wondered in…
user1874594
  • 2,277
  • 1
  • 25
  • 49
0
votes
1 answer

Why statistics have not been recomputed?

I have SQL Server Compact Edition 4.0 database that get ~1K records every day. But over time some queries lost their efficency. I re-checked indexes and statistics and found that the statistics were not updated long time. sp_show_statistics shows me…
Yuriy Gavrishov
  • 4,341
  • 2
  • 17
  • 29
0
votes
0 answers

Teradata SQL : OR conditions vs Union all

My understanding was that most OR conditions can be replaced where performance benefits with UNION ALL. But for these 2 queries the Count ('1') is not the same. Why is it so- am I missing something here. Should it not be the same . Can someone…
user1874594
  • 2,277
  • 1
  • 25
  • 49
0
votes
2 answers

Insert CLOB datatype in Oracle DB via DB link

I am trying to insert data from a text field which is of varchar2(8000) on sql server.I have created a similar column but of clob datatype on oracle db. can you please help me resolve the inconsistent datatypes issue and improve the performance of…
0
votes
1 answer

Does it make sence to split big table querying into several queries to table subsets?

Given we have a big table in a relational database we need to query. We have two options: query the whole table query subsets of data inside the table i.e. rows from 1 to 1000, then 1001 to 2000 etc. Does this separation make some sense? Does it…
MiamiBeach
  • 3,261
  • 6
  • 28
  • 54
0
votes
1 answer

How to force index usage on DB2 while using a scalar value returned by a subquery?

The query runs on a huge table (1 billion records +) Select Col1 from TableA where identcol > (select bigint(identval) from ParamTable) (identval dataype is character and identcol is BIGINT ) This takes a long time and does a full table scan.…
dbza
  • 316
  • 1
  • 5
  • 19
0
votes
2 answers

Mysql (Myisam) variable setting

I have a single processor dedicated server with 4GB RAM and a 400MB Mysql database (Myisam) who has big performance problems. The database is used by an ecommerce. I already tryied to tune it using the mysqltuner script, but without good…
Luca
  • 108
  • 1
  • 11
0
votes
1 answer

need to replace subquery with JOIN

I need to use join in below instead of Subquery. can anybody help me to rewrite this with JOIN. update Table1 set status = 'Edited' where val_74 ='1' and status ='Valid' and val_35 is not null and (val_35,network_id) in …
Shabeeralimsn
  • 797
  • 4
  • 11
  • 32
0
votes
1 answer

MySQL Query for timetable information

I have a table in MySQL as following: +----+--------+------------------+------+ | id | userid | fecha_ingreso | tipo | +----+--------+------------------+------+ | 1 | 1 | 2015-06-08 20:00 | 1 | | 3 | 1 | 2015-06-09 05:00 |…
0
votes
0 answers

sql split table in dynamic and static part

In our system there is a Schedule table which has two parts, one is being extensively updated (fields LockedBy,LockExpirationTime,NextDueTime), and second is mostly static (fields like Enabled,Name,SchedulePartition). In a such configuration does it…
Mikl X
  • 1,199
  • 11
  • 17
0
votes
3 answers

How to tune the following query?

This query gives me the desired result but i can't run this query every time.The 2 loops is costing me.So i need to implement something like view.But the logic has temp tables involved which isn't allowed in views as well.so, is there any other way…
Subek Shakya
  • 595
  • 4
  • 10
  • 28
0
votes
1 answer

oracle olap query execution is taking too long

I have these following tables: 1) date_table_dim 2) clock_table_dim 3) onlinegpspoint : which contains our main information for olap reports And also there is a sql query like this: SELECT date_table_dim.day_id day_id, …
Banafshe Alipour
  • 1,041
  • 4
  • 12
  • 27
0
votes
1 answer

DB2 Query issue - should I use Exists?

I have two tables with large amounts of data. ACTION_SUMMARY and ACTION_DETAIL Every user has one ACTION_SUMMARY row per day in my db, and zero, one or more ACTION_DETAIL rows per ACTION_SUMMARY. I'd like to have a query that does returns users that…
NEW2WEB
  • 503
  • 2
  • 8
  • 22
0
votes
1 answer

Delete Query -To Improve Performance

Below is the query I wrote, wanted to know if i can improve the performance further.Can any one please help me? DELETE FROM GLOBAL_TEMP WHERE EXISTS ( SELECT GLOBAL_TEMP.ASSET_ID FROM TEMP AEE WHERE GLOBAL_TEMP.ASSET_ID = AEE.ID_ASSET…
user1312312
  • 605
  • 1
  • 8
  • 16