Skip to main content

All Questions

Tagged with
0 votes
1 answer
810 views

NOT Equal(<>) in Oracle SQL is ignoring Index and NULL valued rows

I have one query where need to filter based on NOT Equal values in Oracle SQL. Can not use EQUAL to condition as the possible values fo the column in unknown. Query: SELECT * from employee where name &...
atanu2destiny's user avatar
3 votes
2 answers
512 views

How do I get a PostgreSQL execution plan with parameters?

My application has a myriad of queries and I wanted to get the execution plan of some of them. Most if not all of the queries have multiple parameters and I can't find how to get the execution plan ...
Joe DiNottra's user avatar
0 votes
1 answer
75 views

How to understand expain analyze output for query?

I have this query in my database: INSERT INTO value2s(organization, location, device, measurement, timestamp, interval, average, ...
user000001's user avatar
1 vote
1 answer
106 views

Why does Oracle execute both TABLE SCAN and INDEX UNIQUE SCAN on the same table in one query?

I am not looking for a optimization of the following, just an explanation. I have this query: SELECT COUNT(LARGE_A.id_a), SUM(LARGE_A.b_integer) FROM LARGE_A INNER JOIN MEDIUM_A ON LARGE_A.id_a = ...
sanitizedUser's user avatar
1 vote
1 answer
78 views

Similar Query different execution plan and performance

This is the script I use to generate 10M rows on Clients table from 200 different cities. (It took 11 minutes on a desktop PC) *Important note at the end -- Crear la tabla Clientes CREATE TABLE ...
German's user avatar
  • 126
1 vote
1 answer
83 views

Why does the location of the SUM() in an IF statement matter in a GROUP BY scenario when the grouped by column is changed? (BigQuery)?

I have some electrical meter data that I want to group by meter and convert all data to baseline units. The below query does that: SELECT meter, IF(unit="kWh" OR unit="kW", &...
164_user's user avatar
  • 109
1 vote
1 answer
303 views

SQL Server hash match when joining to view

I have a subquery, which always return 1500 rows, because of TOP 1500 on the beginning. It gets left joined to a view, which returns 15mil rows if called outside any context. And in execution plan I'm ...
yoma's user avatar
  • 359
6 votes
1 answer
424 views

How to see the execution plan of a multi-statement table valued function in SQL Server?

I have a view in SQL Server that calls a function. When I show the actual execution plan for querying the view, what happens inside the function is completely opaque though. As a small example, I made ...
Daniel Jonsson's user avatar
0 votes
3 answers
372 views

How to improve slow query performance?

I have a multi-join query that targeting the hospital's chart database. this takes 5~10 seconds or more. This is the visual expain using mysql workbench. The query is below. select sc.CLIENT_ID as '...
Cho's user avatar
  • 163
0 votes
0 answers
56 views

Almost equal table with different running time

I’m using oracle. I have two table A and B Table A has 8000 rows and 5 five columns Table B has 5500 rows and same 5 columns All of 5500 rows in table B are contained in Table A and they are the same ...
Lobster's user avatar
0 votes
1 answer
187 views

How to prevent SQL Server from running the same subquery multiple times

I have a query that follows the following structure: SELECT * FROM ... <generated code> ... (SELECT <fields>, CASE(SELECT TOP 1 ID FROM [Configuration] WHERE IsDefault=...
Eduardo Wada's user avatar
  • 2,647
0 votes
0 answers
67 views

SQL INNER JOIN vs WHERE IN big performance difference

I have read multiple sources and still don't understand where a big difference comes from in a query I have for Microsoft SQL Server. I need to count different alerts linked to vehicles (IdMateriel is ...
Théophane's user avatar
0 votes
1 answer
130 views

SQL Server 2022 : unique index with two columns not working correctly

I have a table with users with over 50000000 entries. I want to check for the presence of already registered users on the server and I execute this request. SELECT * FROM (SELECT TOP (1000) * ...
Sergey Neklyudov's user avatar
0 votes
2 answers
372 views

How to fine tune SQL Server query execution plan generation?

I have a large "Deals" table (1.3 million rows) that needs to be displayed on a paginated grid in my application, the application also includes filters to help the user search through those ...
Eduardo Wada's user avatar
  • 2,647
0 votes
0 answers
68 views

Why doesn't computed column calculation show up in the the Execution Plan?

I have a table with a computed column. It is not persisted. create table dbo.Cases ( ... CaseName varchar(20) not null, NickName AS (dbo.fn_ParseCaseNickName(CaseName)), ... ) When I execute ...
AngryHacker's user avatar
  • 61.1k

15 30 50 per page
1
2
3 4 5
36