Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
216 views

The ORDMBS is PostgreSQL 17.5 on x86_64-suse-linux-gnu, compiled by gcc (SUSE Linux) 7.5.0, 64-bit. I have big table (about 150 GB), partitioned. Full table description: CREATE TABLE table_partition (...
Sergei Grigoriev's user avatar
1 vote
0 answers
78 views

I'm trying to understand what is going on with the explain. I've got Postgresql 14, partitioned table with subpartitions and two queries. First one works not optimal and I'm trying to rewrite it but ...
Aleks M's user avatar
  • 21
0 votes
0 answers
48 views

I've got the following SELECT statement where all columns are properly indexed with the column they're joining on. I.e. all PKs & FKs have a corresponding, single-column index shown later ending ...
Lovethenakedgun's user avatar
1 vote
1 answer
67 views

when in psql: postgres=# EXPLAIN (ANALYSE, FORMAT JSON) SELECT a FROM t; QUERY PLAN ------------------------------------------------------- [ ...
oran g's user avatar
  • 181
2 votes
1 answer
127 views

A nice feature of SQL Server's query planner is that if you do not use any columns from a joined table, and the join does not affect the cardinality of the query, it can be eliminated altogether. You ...
Ed Avis's user avatar
  • 1,622
3 votes
3 answers
225 views

I have a table PaymentItems with 8 million rows. 100'000 rows have the foreign key PaymentItemGroupId = '662162c6-209c-4594-b081-55b89ce81fda'. I have created a nonclustered index on the column ...
Ben5's user avatar
  • 939
1 vote
2 answers
159 views

We have two tables in a Postgres DB. Table1 is a small temp table, Table2 is a huge regular table (> 1 million rows): -- small, temp: CREATE TEMPORARY TABLE Table1 ( uid VARCHAR(15) , idx INTEGER ...
zheng's user avatar
  • 39
1 vote
0 answers
52 views

I'm executing a query as follows: SELECT aad.TABLE_A_ID, JSON_OBJECT( 'details' value (SELECT JSON_ARRAYAGG( JSON_OBJECT( 'domId' value aadd.TABLE_B_ID ) ) ...
Siddhant's user avatar
  • 601
-3 votes
1 answer
72 views

I have a parametized query that receives a string as input. This string varies in length, but never smaller than 10 digits, never longer than 14. When I look at sys.dm_exec_query_stats I can see that ...
Leonardo's user avatar
  • 11.5k
3 votes
3 answers
227 views

What’s the difference between dba_hist_active_sess_history.sql_plan_operation's MERGE STATEMENT (line Id 0) vs. MERGE (line Id 1)? For example, consider the following abbreviated execution plan and ...
Alex Bartsmon's user avatar
0 votes
1 answer
97 views

I have written a query in oracle sql as follows. But the sql query brings the result for a long time. For example, when searching for a customer, the result comes in 4 minutes. Please help me to ...
Narin 's user avatar
  • 19
1 vote
1 answer
83 views

We have two servers having duplicate schemas. We are seeing a difference in the COST and (%CPU). Here are the plans: For the first server (with 12 cores as it's a development environment): ------------...
Adnan's user avatar
  • 27
0 votes
1 answer
97 views

I am currently using the version 8 of Dameng database. In SQL query sentences, I am dealing with a very large table. I have created the same unique index on this table in the development environment, ...
wumingshi's user avatar
1 vote
1 answer
98 views

I'm working through Iztik Ben-Gan book T-SQL Querying. I have some trouble understanding why making a filter less restrictive will make the optimzer move away from a parallel plan to a serial one. The ...
Sveinung Tyssedal's user avatar
1 vote
1 answer
110 views

I am trying to analyze the performance of different query execution plans for a specific object in SQL Server. My goal is to retrieve the top 5 most efficient query plans so that I can compare them ...
Mayur's user avatar
  • 107
2 votes
1 answer
74 views

I am a relatively new developer in PL-SQL Oracle11g. As part of my studies, I am in a debate with the lecturer regarding the effectiveness of the UPDATE operation on a table. In the following code, I ...
SEYATI's user avatar
  • 21
0 votes
0 answers
203 views

I have already created the missing index on the table and the plan keeps telling me there is a missing index? <MissingIndexes> <MissingIndexGroup Impact="10.6268"> <...
user254060's user avatar
2 votes
1 answer
441 views

I have a database with many tables. I need a query to read the next record in key order, given the keys of the current record. [NOTE: I am emulating an old C-ISAM based system, which reads records one ...
Bob Ammerman's user avatar
1 vote
1 answer
316 views

After particular time on solving task and reviewing Snowflake documentation I noticed potential improvement in query for readability and possibly performance improvement. My query is using nested ...
Arthur Shtypuliak's user avatar
3 votes
1 answer
227 views

I have a very simple query that I am testing by running ad-hoc. The execution plan indicates that data is spilling into tempdb because of poor estimates. I have been unable to resolve any of the three ...
James's user avatar
  • 33
0 votes
0 answers
89 views

I am trying to use the LAST_QUERY_PLAN_STATS property to save the QEP Actual of each executed statement in my repository, using DMV sys.dm_exec_query_plan_stats I am able to intercept it and save it ...
AndreaD's user avatar
0 votes
0 answers
79 views

I have these simple tables, one without indexes and the other with only a primary key and clustered index on id: CREATE TABLE [dbo].[MyTableWithoutPk]([id] [int] NOT NULL, [category_id] int NULL) ...
Julian's user avatar
  • 37.3k
2 votes
1 answer
597 views

I'm trying to improve the performance of one of our most expensive queries. I'm running EXPLAIN ANALYZE on the sandbox postgres 15 database, which has a much smaller dataset than the production ...
Christian Bueche's user avatar
0 votes
0 answers
65 views

I have table of the following structure: create table my_table ( id int auto_increment primary key, name varchar(255) null, vendor_name ...
Muslimbek Abduganiev's user avatar
0 votes
1 answer
220 views

In my application I have a simple insert, when captured with profiler it looks like this insert into ford.tblFordCompoundFlowVehicle (FordCompoundFlowID, CompoundVehicleID, SortOrder, Status1ToSend, ...
GuidoG's user avatar
  • 12.3k
1 vote
1 answer
181 views

I have this snippet of a PostgreSQL explain plan I'm trying to comprehend: -> Nested Loop (cost=0.57..933455.16 rows=11 width=122) (actual time=3.710..497.990 rows=86102 loops=1) -> ...
Richard Wheeldon's user avatar
0 votes
2 answers
201 views

I'm using SQL Server 2016/2019. I want to extract (for given @QueryPlanHash BINARY(8) = 0x397CEDB37FA0E1D2) from execution plan XML in cache - which statistics was used to generate that plan. This ...
MegaCalkins's user avatar
1 vote
2 answers
1k views

I have a table with ~35M rows, and trying to find "processed" records to remove from time to time. There are 14 valid statuses, and 10 of them are processed. id uuid default uuid_generate_v4(...
JJS's user avatar
  • 6,848
0 votes
1 answer
198 views

I have a leading wildcard query I know it is hard to optimize. I know if I use only the trailing wildcard I can do some optimization. But our client wants the leading wildcard because when searching ...
Qiulang's user avatar
  • 12.9k
1 vote
0 answers
43 views

I ran explain command on this query: EXPLAIN Select * from project_project where id < 10 FOR UPDATE And the plan output: "LockRows (cost=0.00..6.57 rows=12 width=18305)" " -> ...
Azima's user avatar
  • 4,161
0 votes
1 answer
95 views

I have the following query: SELECT cp.ID_Case FROM dbo.CaseParty cp (NOLOCK) JOIN dbo.Client cli (NOLOCK) ON CASE WHEN cli.ClientType = 'atty' AND cp.ID_ClientAttorney = cli.ID_Client THEN 1 ...
AngryHacker's user avatar
  • 62.2k
0 votes
0 answers
118 views

Fairly simple schema: CREATE TABLE IF NOT EXISTS Queue( Id BIGSERIAL NOT NULL PRIMARY KEY, SendAt TIMESTAMP(3) NOT NULL, Payload TEXT NOT ...
milan's user avatar
  • 2,545
3 votes
2 answers
195 views

As far as I understand, given a query, Oracle tries different approaches based on some heuristics, where I guess the most driving factor is minimizing the number of rows to work with, and then chooses ...
ABu's user avatar
  • 12.5k
0 votes
2 answers
139 views

I have two columns: column1 with two distinct values (0, 1) and column2 with 3 distinct values ('A', 'B', 'C'). Value in column1 is always 0 for 'A' and 'B' in column2, but if the value in column2 is '...
Bunny Boss's user avatar
2 votes
1 answer
767 views

I'm trying to grab a query plan for my query. However, I do not have direct access to the db and can only run SELECT statements on my end. Is there a way to wrap SELECT around EXPLAIN, maybe even ...
Kamran Maharramli's user avatar
0 votes
0 answers
84 views

in general Why does the sum of CPU times from individual nodes in the query's execution plan differ significantly from the total execution time reported by SET STATISTICS TIME ON? assume the query ...
Arun Prasanth's user avatar
-1 votes
2 answers
131 views

I wrote a SQL query to fetch all movies and, if present, include the name 'Brad Pitt' for movies where he's a cast member. The query is as follows: select m.title, p_cast.person_name From movie m ...
Sérgio Mergen's user avatar
-1 votes
1 answer
519 views

I have 2 questions: Is it any way to optimize or rephrase this query that I will be able to execute it? I was waiting for over 2 days and the query was still executing... How does the "cost&...
Slawowid's user avatar
0 votes
1 answer
58 views

I see that a full table scan is planned, however it's never executed and the UPDATE takes a long time anyway. Why?? Here's the EXPLAIN output Update on public.hone_cohortuser (cost=3180.32..8951.51 ...
Marcos's user avatar
  • 1,484
1 vote
1 answer
96 views

I have dataframe called source_dataframe which is referenced by multiple places in the pyspark code. Hence, I was planning to cache the data frame source_dataframe, so that cached referenced would be ...
user16798185's user avatar
1 vote
1 answer
244 views

I have a table 'analytics_event' (with 9.7M rows) which I need to query for records 'created' after a given time. The table has various indexes which are being ignored in favour of a seq scan over the ...
JP D's user avatar
  • 13
2 votes
1 answer
441 views

I'm evaluating some Plan Cache behaviors and this is my scenario. I'm running the following two queries separately: SELECT TOP 10 * FROM dbo.Countries CT LEFT JOIN dbo.Continents CN ON CT.ContinentId=...
DSD's user avatar
  • 31
1 vote
1 answer
279 views

Trying to troubleshoot a MariaDB query. We did an explain select on the select. A couple of the rows in the output have value ref|filter for the type column. What does this mean? The MariaDB docs ...
Adam's user avatar
  • 6,812
0 votes
0 answers
135 views

Below is the select query which takes 1515 seconds to finish. Can some one help me improve the query performance by looking into the execution plan provided below. As mentioned in the execution plan, ...
to-find's user avatar
  • 97
2 votes
1 answer
987 views

I'm testing how join works with hash index in PostgreSQL 16.2. Here is a test table. Just 2 columns with numbers in text format. create table join_test ( pk varchar(20), fk varchar(20)); ...
Anton Ivanov's user avatar
-1 votes
1 answer
148 views

Using ActivityMonitor, I got an SQL query that is slow. It looks like this: SELECT 1, 2, 3, FROM MyTable WHERE Column1 = @parameter1 AND Column2 = @parameter2 How do I execute the query with ...
Liero's user avatar
  • 27.8k
2 votes
0 answers
319 views

We recently migrated our database from MariaDB version 10.3.39 to 10.6.16 and have encountered significant performance issues with many of our older, mostly unoptimized queries. We've isolated one ...
FabianP's user avatar
  • 21
1 vote
1 answer
4k views

There are many places that talk about this question but none fully explain it - all leave it ambiguous. Examples: PostgreSQL's own documentation pgMustard's page on the topic From what I've been ...
Learner's user avatar
  • 1,333
1 vote
2 answers
426 views

So I have this query which is extremely slow to run - SELECT "conversation".*, "teamBotLocation"."id" AS "teamBotLocation.id", "teamBotLocation&...
Manish Boro's user avatar
1 vote
0 answers
109 views

I have two queries that would produce equivalent results (though the subquery one is sorted). However, it seems like the one that uses subquery is faster and I'm not sure why. Could someone explain ...
Jacky Boen's user avatar

1
2 3 4 5
30