Basic SQL Implementation - Doubts

52 views
Skip to first unread message

Dobi

unread,
Jan 15, 2015, 7:37:38 AM1/15/15
to orient-...@googlegroups.com

Hello,

OrientDB version 1.7.10

We are running the following two queries and number of records returned are different.

select from (select from sitedata ) where localdate='2014-09-24'
select from sitedata where  localdate='2014-09-24'

The first query returns 6 records where as the second one returns only one record.

Sitedata is a vertex and localdate is a property with Date datatype. There is an index created on the localdate as well.

Conceptually what is the difference between the two queries? In the first scenario we are creating what is known as an inline view in RDBMS world and then putting a filter on the records in the in line view. We assume it must be internally fetching all records from database and then filtering in memory. In the second query the the data is directly being filtered and the index will be used.

Best,

Dobi

Dobi

unread,
Jan 15, 2015, 8:27:35 AM1/15/15
to orient-...@googlegroups.com
Update - The problem was because of the index.
The index was created as Dictionary and that as causing the problem.

Changing the index fixed the issue.
Reply all
Reply to author
Forward
0 new messages