All Questions
24
questions
1
vote
0
answers
33
views
postgresql EXPLAIN gives seq scan rows = 12 for filter id < 10
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)"
" -> ...
0
votes
1
answer
137
views
How to get explain for a foreign table
I have a query that is essentially
SELECT *
FROM foreign_table_a
LEFT JOIN local_table_b on foreign_table_a.id = local_table_b.id
I'm looking at the explain analyse in datagrip and I don't really get ...
-1
votes
1
answer
33
views
How can I optimize DB query?
My db query is taking 5 seconds instead of <1 second earlier and the culprit query is :
explain extended
select A,B,C
from table flow
where
(status in ('X' , 'Y' , 'Z'))
and priority=1
and ...
3
votes
2
answers
446
views
Why INSERT query is 3-4 times slower than SELECT?
Application talks to YugabyteDB instance with YCQL driver(Gocql).
We have below two queries (for example):
SELECT col2,
col3,
col4,
col5
FROM table1
WHERE primarykeycol = ...
2
votes
1
answer
790
views
PostgreSQL EXPLAIN: How do I see a plan AS IF certain tables had millions of rows?
This is a question about PostgreSQL's EXPLAIN command. This command shows you how the optimizer will execute your SQL based on the data in your tables. We are not in prod yet, so all of our tables ...
1
vote
2
answers
314
views
How to get number of rows accessed in each table of a query sql Oracle DB
I have to get number of rows accessed in each table in sql query - oracle db. For example:
select *
from a inner join b on a.t = b.t
where a.x in (1,2,3)
result expect:
table a: 5 rows
table b: 10 ...
2
votes
2
answers
90
views
Why and how SQL condition not in psql explain plan?
I try to analyze plans for join query benchmark https://github.com/gregrahn/join-order-benchmark
For example, I execute the following command:
EXPLAIN SELECT *
FROM aka_name AS an,
cast_info AS ...
0
votes
1
answer
627
views
Postgresql: Seq Scan instead of Index Scan
I have following table:
create table if not exists inventory
(
expired_at timestamp(0),
-- ...
);
create index if not exists inventory_expired_at_index
on inventory (expired_at);
However ...
0
votes
4
answers
299
views
How is `rows` param in `explain analyze` (postgresql) estimated in case of a function scan?
I was checking execution plans for parts of a complicated query and came up with this:
postgres=# explain analyze ...
3
votes
1
answer
2k
views
PostgreSQL: Is it possible to print the query plan of a running query?
I ran the same report query regularly and most of the time the query completes within minutes. However, it sometimes gets stuck for hours in a nondeterministic way. When it got stuck, I repeated the ...
7
votes
1
answer
3k
views
Why is Postgres EXPLAIN ANALYZE execution_time different than when I run the actual query?
I'm using a database client to test.
Using EXPLAIN ANALYZE:
Hash Join (cost=5.02..287015.54 rows=3400485 width=33) (actual time=0.023..1725.842 rows=3327845 loops=1)
Hash Cond: ((fact_orders....
0
votes
1
answer
167
views
Why does PostgreSQL sorts on a boolean WHERE condition?
I am testing some queries over a bunch of materialized views. All of them have the same structure, like this one:
EXPLAIN ANALYZE SELECT mr.foo, ..., CAST(SUM(mr.bar) AS INTEGER) AS stuff
FROM ...
14
votes
1
answer
7k
views
What does loop in explain analyze statement mean?
I am profiling my query.
postgres=# explain analyze select * from student;
QUERY PLAN
--------------------------------------------------------------------...
0
votes
1
answer
2k
views
Using IN with a subquery doesn't use index
I have the fowlloing query
select * from mapping_channel_fqdn_virtual_host where id in (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
explaining the above query gives me the following result:
explain select * ...
2
votes
0
answers
2k
views
Explaining the Explain in teradata
Explain
sel * from sandbox.comapny_employees ce
left join
sandbox.comapny_age ca
on ce.age=ca.age and ce.age>42
some times its really confusing to understand how explain plan was ...