question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQL queries executor should consider @class WHERE clauses while resolving indexes

See original GitHub issue

For queries like select from V where @class='Person' and name='foobar' no Person indexes are considered while searching for applicable indexes. We should try narrow down the possible document class and examine its indexes while executing the query.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
taburetcommented, May 19, 2016

ODB will try to use the best index possible if you use queries like select from SpecificClassHere where.... This issue is applicable only if you use queries with no specific class specified and later filter by the class in where clause using @class. So, the answer is yes, ODB will use the index on indexed properties, there is no need to specify the concrete index.

0reactions
smolinaricommented, May 19, 2016

Thank Sergey. I’ve created an issue with the suggestion. Sorry again for hijacking this issue.

Scott

Read more comments on GitHub >

github_iconTop Results From Across the Web

Query Processing Architecture Guide - SQL Server
The logic used by the SQL Server Query Optimizer to decide when to use an indexed view is similar to the logic used...
Read more >
Does the order of where clauses matter in SQL?
No, that order doesn't matter (or at least: shouldn't matter). Any decent query optimizer will look at all the parts of the WHERE...
Read more >
Conditional WHERE clauses in SQL - Avoid Smart Logic
As a consequence, the database uses a full table scan even if there is an index for each column. It is not that...
Read more >
Best practices for writing SQL queries - Metabase
SQL best practices: a brief guide to writing better SQL queries. ... consider creating an index with a WHERE clause to limit the...
Read more >
Tracing and tuning queries using SQL Server indexes
In this blog post, we are going to discuss step by step how to tune the performance of the bad queries using SQL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found