Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

query with date takes too long #52

Closed bazo closed 8 years ago

bazo commented 8 years ago

i have a vertex called CompetitionRound which has a start property which is a date

then i run a single query

SELECT FROM CompetitionRound WHERE start <= "2015-10-17"

it is 1 result only

in studio it takes around 50ms or less

in php it takes > 5s

that's a really large difference

something is very wrong with this driver

ncreea commented 8 years ago

I'm experiencing the same behavior. A query that is executed under 1s via studio, takes more then one minute to execute via the driver. Please help.

pentium10 commented 8 years ago

We seen the same issue on a production server @Ostico do you know when this will be fixed? or how to fix it?

pentium10 commented 8 years ago

@andreyvk do you have an idea why this happens to a few of us?

andreyvk commented 8 years ago

@pentium10 No i dont. I have not paid attention to this one yet,. Although I should say that I do have a few queries that include dates. So does that happen on any date query?

create class Test extends V

create property Test.myDate date

insert into Test set myDate='2015-01-01'

Then if I use PhpOrient to query for that record will that cause a delay?

When I have a few minutes I'll give it a try...

Ostico commented 8 years ago

Hi all, i tried this script with PhpOrient v1.2.1 and OrientDB 2.1.5 on Ubuntu Linux and it works fast as expecting:

        $db_name = 'test_date';
        $client = new PhpOrient( 'localhost', 2424 );
        $client->connect( 'root', 'root' );

        try {
            $client->dbDrop( $db_name, Constants::STORAGE_TYPE_MEMORY );
        } catch ( \Exception $e ) {
            $client->getTransport()->debug( $e->getMessage() );
        }

        $client->dbCreate( $db_name,
            Constants::STORAGE_TYPE_MEMORY,
            Constants::DATABASE_TYPE_GRAPH
        );

        $client->dbOpen( $db_name, 'admin', 'admin' );

        $client->command( "create class Test extends V" );
        $client->command( "create property Test.myDate date" );
        $client->command( "insert into Test set myDate='2015-01-01'" );
        $result = $client->query( "SELECT FROM Test WHERE myDate <= '2015-10-17'" );

//output
        print_r($result);

However, i think this is not directly related with PhpOrient because the data are extracted and correctly parsed if you receive them. The unique possible reason for that issue is a connection issue ( low transferring rate ) or an overload of your database and so, a delay in the response.

I will close this issue. Re-open it if you can provide a valid test case or dataset to replicate the behaviour.

pentium10 commented 8 years ago

providing access to a dev machine would help you?

Ostico commented 8 years ago

Sure it can helps, if this is a valid possibility for you, send me the the passwords.

If i must sign a "Non disclosure agreement" let me know.