orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
327 stars 67 forks source link

Query execution time difference with or without indexing #425

Closed rohitpatil7892 closed 3 years ago

rohitpatil7892 commented 4 years ago

I have 2 queries for traversing records from DB with indexing and without indexing. I executed both queries but the execution time is the same for both. Person table having 50000 records with indexing on ID property.

1. SELECT * FROM person WHERE ID = "abc123" LIMIT 1

2. SELECT EXPAND(rid) FROM person.ID WHERE key = 'abc123'

**1. Can both query use indexing to traverse?

  1. Which one will execute faster and why?**
wolf4ood commented 4 years ago

Hi @rohitpatil7892

can you provide the explain of those queries?

Thanks

VikramShityalkar commented 4 years ago

Hi @wolf4ood

We went through SQL Optimization again. By looking at explain, we found that it is using index in # 1 query. Please let me know if you have any other documentation that we can refer for optimization.

This issue can be closed.

VikramShityalkar commented 4 years ago

There is following comment available on page:

V 3.0 has a completely new execution planner, so none of these tips can be considered valid on that version.