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.
Questions tagged [sql-tuning]
328 questions
0
votes
1 answer
Performance issue - PL/SQL fetch cursor to table of records with bulk collect
I want to process a large amount of records and I am using bulk collect instruction to fetch the data into a table of records. However, I am sure there is a more adequate way to achieve what I am looking for. Here is the code:
FUNCTION…

ruifgmonteiro
- 639
- 8
- 15
0
votes
1 answer
joining multiple complicated tables on mysql
I am trying to find all customers who answered 'facebook' on the question "platform" (id 1)
each customers have questionnaires and I am trying to look for customers who answered "facebook" on questions "platform" the id for questions are fixed for…

Johji
- 240
- 1
- 19
0
votes
0 answers
SQL Developer never returns the result
As you know, if I execute a SQL statement, SQL Developer returns the first 50 rows. To make the database return all the rows, I sometimes select the output and press CTRL+A. So it reads all the rows from the database.
When I run the query below and…

oramas
- 881
- 7
- 12
0
votes
1 answer
Optimizing 5 inner join
I have a customer table and questionnaire table both have questionnaire_answers , and both questionnaire_answers and question table have answers , I don't know if the problem is in the model design in the first place but the below query return 4,000…

Johji
- 240
- 1
- 19
0
votes
2 answers
Function-Based Index on numeric Column
I have a table containing some numeric columns, and i have to keep them numeric because most of the time i will benefit from that. But i need also to make a generic search on those columns using partial matches so in my where statement i will have…

kefer9
- 334
- 4
- 7
0
votes
1 answer
optimizing this piece of a stored procedure
So this is a piece of a stored procedure that I'm tuning. I have found that this runs very slow. I takes about 3 hours. I think database may lack indexes or views. I believe that the joins are the reason that it's so slow, but I don't know a way to …

King Love
- 7
- 4
0
votes
1 answer
Update an indexed column Oracle
Let's assume that we have a table (cars) with a indexed column (category)
contains values like 'A' , 'B' , 'C'.
If I want to tune the update on this column knowing that I use it in where condition like:
update cars set category = 'Class A' where…

Mhd H_Nahhas
- 27
- 1
- 4
0
votes
1 answer
Query optimization [Oracle]
How can I optimize the performance of this query?
SELECT Count(DISTINCT DT.id)
FROM pcwdeptrans DT
INNER JOIN pcwitemtotal IT
ON DT.id = IT.deposittransid
LEFT OUTER JOIN pcwdepreceipt DR
ON…

Dothertechie
- 27
- 6
0
votes
1 answer
Payroll table structure - SQL
I have Payroll process implemented in SQL server 2012.
Table having 365 columns in order to store details of each day for different PayHead section.
PayHead includes (Basic,HR,Deduction,ESIC,Tax,PF,etc..)
Is it a good idea to make all this 365…

Jignesh patel
- 23
- 12
0
votes
1 answer
Is it ok to truncate a LOG file during Fulltext Index Repopulation?
A simple question ...
As part of a database maintenance routine we occasionally completely delete and rebuild a Fulltext Index and its underlying Clustered index.
This works quite well, and there is no problem with it, apart from ONE thing:
After we…
user6499401
0
votes
1 answer
Performance of date time concatenation into timestamp
Oracle 12C, non partitioned, no ASM.
This is the background. I have a table with multiple columns, 3 of them being -
TRAN_DATE DATE
TRAN_TIME TIMESTAMP(6)
FINAL_DATETIME …
0
votes
0 answers
Tuning Postgres queries
I have a requiremnt to join two tables based upon negation condtion, which is taking much time to execute.
SELECT oola.ship_from_org_id ,
oola.subinventory,
oola.line_id ,
crl.requirement_header_id,
crl.inventory_item_id
FROM…

Pooja
- 327
- 1
- 5
- 20
0
votes
2 answers
Attempting to optimize a query that is taking a long time to execute
I am having slow return times based on amount of data for the following query.
mysql> explain select *
from worker_location
where gate_id not in (
SELECT gate_id from worker_address
…

user3299633
- 2,971
- 3
- 24
- 38
0
votes
2 answers
Debugging an ASP.NET website that is running slowly?
We're getting more and more complaints from users that our ASP.NET 4.5.2 website is running slowly or just generally "freezing up." Things look fine from our test servers and from our workstations, but we're probably using better workstation…

Tim Westover
- 327
- 1
- 14
0
votes
2 answers
Query Tuning in PostgreSQL
I have a query that is running in 17s, but I can not think of a way to optimize this query. Some help is much needed.
EXPLAIN ANALYSE
CREATE materialized VIEW professores_fizeram_planejamentoTEST as
SELECT unities.id as id_escola,
…

Rodolfo Peixoto
- 3
- 2