All Questions
Tagged with sql sql-execution-plan
535
questions
2
votes
2
answers
246
views
Why is Postgres execution plan changing vastly based on where condition
I am trying to execute the same SQL but with different values for the where clause. One query is taking significantly longer time to process than the other. I have also observed that the execution ...
0
votes
1
answer
1k
views
SQL Server error - The SET SHOWPLAN statements must be the only statements in the batch
I am trying to generate a showplan table in SQL Server. I am getting this error when I try to do this
Msg 1067, Level 15, State 1, Line 0
The SET SHOWPLAN statements must be the only statements in ...
1
vote
1
answer
293
views
Why does the query planner start picking a worse plan after a certain number of joins inside a CTE?
I have the following query:
EXPLAIN ANALYZE
WITH up AS (
SELECT
ua1.id ua1_id,
gp1.id gp1_id,
upai1.id upai1_id,
upbi1.id upbi1_id,
upiv1.id upiv1_id,
vi.id vi_id,
c.id ...
0
votes
1
answer
354
views
Oracle not using my bitmap indexes in my query
The test_data table I am using in my query can be generated as per the below code:
DROP TABLE test_data;
CREATE TABLE test_data (
random_value NUMBER,
random_string VARCHAR2(20),
...
0
votes
1
answer
61
views
Mysql Query Optimization for this particular query
I am having a mysql query which is taking roughly 2.6s to execute. At first it was not using index. Now I added index to it. But still no improvements. Any suggestion on this:
select posummary0_.id ...
2
votes
2
answers
840
views
SQL Query Execution Plan Analyzer Tool [closed]
I am using RDS Aurora PostgreSQL and I am new in PostgreSQL. I have been trying to analyze Execution Plans for queries in PostgreSQL.
I realized that manual audit on these plans take times, may need ...
2
votes
1
answer
1k
views
SQL Server execution plan in XML for query is too large to be displayed or saved in full
I am trying to obtain the execution plan in XML for a large T-SQL query. I am able to run the query to obtain the execution plan.
However, the resulting XML execution plan text is too long to be fully ...
2
votes
2
answers
147
views
Identical SELECT vs DELETE query creates different query plans with vastly different execution time
I am trying to speed up a delete query that appears to be very slow when compared to an identical select query:
Slow delete query:
https://explain.depesz.com/s/kkWJ
delete from processed.token_utxo
...
1
vote
1
answer
2k
views
How to avoid performance degradation when run query with cast in where clause?
I have a table with 2 varchar columns (name and value)
and I have such a query:
select * from attribute
where name = 'width' and cast( value as integer) > 12
This query works but I suppose there ...
1
vote
1
answer
874
views
SQL execution plan has sort
I'm using the AdventureWorks database, ran the below query:
-- 9
select *
from Production.ProductModel
where not exists
(
select 1
from Production.Product
where Production.Product....
0
votes
1
answer
681
views
Explain plan hint details as plain text
I'm trying to learn how to force Oracle 18c to use a function-based index — by using a hint:
--I've omitted the custom function and function-based index because it cluttered the question too much.
--...
0
votes
0
answers
98
views
Insert of records into SQL Server is slow whereas select is quicker
I am trying to improve the performance of insert in SQL Server.
INSERT INTO [dbo].[GroupCustomerAccountProductRebates]([GroupId],[GroupName],[ProductId],[ManufacturerProductCode],[ProductDescription],[...
0
votes
1
answer
1k
views
Postgres query cost is higher but runs faster
Update on 2022-05-15
After running vacuum analyze, the query plans are below.
For A query
Nested Loop Left Join (cost=45913.11..496597.16 rows=10 width=128) (actual time=115.205..3068.596 rows=10 ...
2
votes
0
answers
108
views
Improve performance of SQL query
I have a slow performing query which I am at a loss on how I could make more efficient. SQL isn't my speciality, but currently this query is taking about 3 seconds on average to run. I've run an ...
1
vote
1
answer
341
views
What the decimal number in seconds bellow the cost percentage means in the SQL Server Graphical Execution Plan?
The number is highlighted in the image below.
It would be nice to have a reference to some Microsoft Doc explaining it as well.