Questions tagged [query-planner]

A query planner is a subsystem of a SQL database system, that creates the execution plan for a SQL query.

A query planner is a subsystem of a SQL database system, that creates the execution plan for a SQL query.

135 questions
0
votes
0 answers

Same mongodb query gives different explain plan

I have two mongo queries, the only change in a query is merchantId field still both queries giving me different winning plan. First…
0
votes
1 answer

Postgres using primary_key index in almost every query

We're upgrading our postgres database from version 9.3.14 to 9.4.9. We're currently under testing phase. We've encountered a problem while testing which leads to high CPU usages when the database is updated to 9.4.9. There are queries where Postgres…
Rahul Sharma
  • 5,562
  • 4
  • 24
  • 48
0
votes
1 answer

Why is setting enable_indexscan to False not working?

I'm trying to compare a query's performance with and without an index. I tried setting enable_indexscan to False, but the query planner still uses an index (EXPLAIN SELECT ... shows exactly the same result). What am I doing wrong? Here's what I'm…
lfk
  • 2,423
  • 6
  • 29
  • 46
0
votes
1 answer

Create MySQL Workbench query plan image from command line / terminal

Is there a way to create MySQL Workbench query plan image from command line or terminal and save it as an image something like this? I checked the MySQL Workbench documentation here,…
Stranger
  • 10,332
  • 18
  • 78
  • 115
0
votes
2 answers

sql query runs slower than expected

I have a table foo(a1, a2, a3, a4, a5) a1 is the primary key. there is a non-clustering index on a5. I have a simple query: SELECT * FROM foo WHERE a5/100 = 20; This query runs significantly slower. updating the statistics used in query planning…
blabla
  • 303
  • 1
  • 4
  • 13
0
votes
0 answers

Postgresql too slow spatial intersection analyse

I have a postgres database with a table (approx. 150 000 rows) with three columns; row_id, position and number of flowers counted. Since the position is rather close to each other might there be some error in the counting and I want to know the…
axel_ande
  • 359
  • 1
  • 4
  • 20
0
votes
0 answers

Planner Postgresql does not see the new partitions in the database

I have a problem with the planner postgresql I had a table with several partitions, then added a considerable number of subsequent partitions. EXPLAIN on the main table does not show the new partitions. SELECT performed on the main table does not…
0
votes
0 answers

Different planner and query time on postgres development vs production db

I'm facing a strange problem. While i'm developing new feautures of my application, i create dumps of production db loading them on my dev environment. If i try to run the same query on development and in production, i get 2 different plans,…
0
votes
3 answers

How does HAWQ split query plan into slices?

A query plan in HAWQ can be split into several slices which can be run independently. How does HAWQ split query plan into slices?
0
votes
1 answer

Can database execution plan be reused when parameter count in *IN* clause changes?

If a query is executed with 10 parameters in an IN clause, and then the same query is executed again but with 20 parameters, can the database server reuse the execution plan from the first run, or is a fresh execution plan having to be created each…
riceball
  • 403
  • 2
  • 15
0
votes
1 answer

PostgreSQL - weird query planner behavior

Assume I have a query like this: SELECT * FROM clients c INNER JOIN clients_balances cb ON cb.id_clients = c.id LEFT JOIN clients com ON com.id = c.id_companies LEFT JOIN clients com_real ON com_real.id = c.id_companies_real LEFT JOIN…
Yurii Dolhikh
  • 59
  • 1
  • 1
  • 7
0
votes
1 answer

What has changed in sqlite3 so that the query plan does not show the estimated number of rows anymore?

In version 3.7.8 the query plan looked like SCAN TABLE Cities (~1000000 rows) SEARCH TABLE PostalCodes USING INTEGER PRIMARY KEY (rowid=?) (~1 rows) but with 3.8.10.2 it is SCAN TABLE Cities SEARCH TABLE PostalCodes USING COVERING INDEX…
Fabian
  • 4,001
  • 4
  • 28
  • 59
-1
votes
1 answer

Optimizing OUTER JOIN queries using filters from WHERE clause.(Query Planner)

I am writing a distributed SQL query planner(Query Engine). Data will be fetched from RDBMS(PostgreSQL) nodes involving network I/O. I want to optimize JOIN queries. Logical Order of Execution is: Do JOIN(make use of ON clause) Apply WHERE clause…
-1
votes
1 answer

Very slow performance for inner join with restrictive where clause (very small subset of rows)

I have two large tables that I am joining using an intermediate mapping table (details of structure below). I am trying to join all three on t1.date = t2.date and t1.id_a = int.id_a and int.id_b = t2.id_b I also have a where clause that restricts…
tim654321
  • 2,218
  • 2
  • 15
  • 19
-2
votes
0 answers

Restructure SQL to enable query-planer to use result from subquery efficiently

I have a query: select * from tableA where colA > (select max(colA) from tableB) This is terribly slow compared to: select * from tableA where colA > 10 There are indices on tableA and tableB on colA. If it matters, this problem occurs in…
Vertago
  • 315
  • 2
  • 16
1 2 3
8
9