Hi Luigi,

Would you mind elaborating what kind of small test case you refer to? Do 
you mean sample source code to produce it? I just have a very simple class 
with few properties shown below. I just insert it with 1.2 million loop and 
the code as follow. Then I go to the web interface and type the SELECT 
command. It is very fast if I only filter 1 record. however, it is slow and 
keep prompting me more than 50,000 records kind of message and asked me to 
do indexing. Even though the select criteria shall only return 1 result.

public static void TestOrientDB()
        {
            var GlobalTestDatabaseName = "TestDatabaseName";
            var GlobalTestDatabaseType = ODatabaseType.Graph;
            var GlobalTestDatabaseAlias = "TestDatabaseNameAlias";
            
            _server = new OServer(_hostname, _port, _rootUserName, 
_rootUserParssword);
               OClient.CreateDatabasePool(
                _hostname,
                _port,
                GlobalTestDatabaseName,
                GlobalTestDatabaseType,
                _username,
                _password,
                10,
                GlobalTestDatabaseAlias
            );
            DateTime startTime = DateTime.Now;
            Console.WriteLine("Start Time: " + 
startTime.ToLongTimeString());

            using (ODatabase database = new 
ODatabase("TestDatabaseNameAlias"))
            {

                for (int count = 1; count <= 1000000; count++)
                {
                    var employee = new Employee();
                    employee.Id = "1234567890123456789012345678901234";
                    employee.Key = "1234567";
                    employee.Revision = "1234567";
                    employee.Name = "Mohamad Abu 
Bakar123456789012345678911234dddddd";
                    employee.IcNumber = "1234567-12-3444";
                    employee.Department = "IT Department";
                    employee.Height = 1234;
                    employee.DateOfBirth = new DateTime(2015, 1, 27, 3, 33, 
3);
                    employee.Salary = (decimal)3333.123456789 + (count * 
10);

                    database.Insert().Into("Employee").Set("Id", 
employee.Id)
                                .Set("Key", employee.Key)
                                .Set("Revision", employee.Revision)
                                .Set("Name", employee.Name)
                                .Set("IcNumber", employee.IcNumber)
                                .Set("Department", employee.Department)
                                .Set("Height", employee.Height)
                                .Set("DateOfBirth", employee.DateOfBirth)
                                .Set("Salary", employee.Salary).Run();
                    


                }
            }

            

            DateTime endTime = DateTime.Now;
            TimeSpan duration = endTime - startTime;
            Console.WriteLine("End Time: " + endTime.ToLongTimeString());
            Console.WriteLine("Total time taken: " + duration.TotalSeconds);
        }


 public class Employee 
    {
        public string Id { get; set; }

        public string Key { get; set; }

        public string Revision { get; set; }


        public string Name { get; set; }

        public string IcNumber { get; set; }

        public string Email { get; set; }

        public string Department { get; set; }
        public double Height { get; set; }

        public DateTime DateOfBirth { get; set; }

        public decimal Salary { get; set; }
    }

On Friday, January 30, 2015 at 5:31:29 PM UTC+8, Luigi Dell'Aquila wrote:
>
> Hi Siang,
>
> all hash indexes do not support range queries (they are based on hash of 
> course, not on a tree).
> But standard NOT_UNIQUE should, so if it doesn't work I suggest you to 
> write a small test case or all the steps to replicate the problem, we'll be 
> happy to look at that.
>
> Thanks
>
>
>
> 2015-01-30 9:55 GMT+01:00 Siang Hwee Goh <[email protected] 
> <javascript:>>:
>
>> Hi Luigi,
>>
>> I have tried on NOT_UNIQUE and NOT_UNIQUE_HASH_INDEX. Both also not 
>> working. Based on my understanding from 
>> https://github.com/orientechnologies/orientdb/wiki/Indexes, I thought 
>> that will be the most fit at my scenario. Do you have any suggestion? 
>> Thanks. 
>>
>> On Friday, January 30, 2015 at 4:43:25 PM UTC+8, Luigi Dell'Aquila wrote:
>>>
>>> Hi Siang,
>>>
>>> which kind of index did you define? Not all types of index support range 
>>> queries
>>>
>>> Luigi
>>>
>>>
>>> 2015-01-30 9:05 GMT+01:00 Siang Hwee Goh <[email protected]>:
>>>
>>>> I am evaluating OrientDB right now and I tried to inserts 1.2 million 
>>>> simple records inside one of the database. It is an Employee class with 
>>>> just few columns. 
>>>>
>>>> When I tried to perform the query on SELECT * FROM Employee WHERE 
>>>> salary = 1343 it was very slow and ended up no result being returned. I 
>>>> did 
>>>> some indexing and now it became very fast. 
>>>> However, when I tried to again change the query a little bit to this 
>>>> SELECT * FROM Employee WHERE salary >= 3330 AND salary <= 3330 it ended up 
>>>> return nothing again and prompted me the transactions is more than 50,000 
>>>> records and ... As a matter of fact, there is only 1 record inside which 
>>>> fulfill this search criteria. Could anyone let me know how to tune the 
>>>> performance in such case? Thanks.
>>>>
>>>> -- 
>>>>
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "OrientDB" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to