Skip to content

Instantly share code, notes, and snippets.

@vitorenesduarte
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitorenesduarte/b01b7922b7e8e6075117 to your computer and use it in GitHub Desktop.
Save vitorenesduarte/b01b7922b7e8e6075117 to your computer and use it in GitHub Desktop.
NOTUNIQUE_HASH_INDEX
vitorenes:~$ ssh ...
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-46-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Mon Apr 6 11:13:58 UTC 2015
System load: 3.8 Processes: 119
Usage of /: 89.6% of 49.09GB Users logged in: 1
Memory usage: 50%
Swap usage: 0%
=> / is using 89.6% of 49.09GB
mymachine:~$ cd orientdb-enterprise-2.0.6/
mymachine:~/orientdb-enterprise-2.0.6$ nohup ./bin/server.sh > ./log/server.log 2>&1 &
[1] 18005
mymachine:~/orientdb-enterprise-2.0.6$ ./bin/console.sh
OrientDB console v.2.0.6 (build UNKNOWN@r; 2015-03-31 18:22:35+0000) www.orientechnologies.com
Type 'help' to display all the supported commands.
2015-04-06 11:24:17:992 INFO OrientDB auto-config DISKCACHE=2,621MB (heap=455MB os=15,042MB disk=5,242MB) [orientechnologies]
Installing extensions for GREMLIN language v.2.6.0
orientdb> connect remote:localhost/MYDB admin admin
Connecting to database [remote:localhost/MYDB] with user 'admin'...
orientdb {db=MYDB}> select type, indexDefinition from (select expand(indexes) from cluster:0) where name = 'Post.isFeatured' or name = 'User.isFeatured' or name = 'Tag.isFeatured'
----+------+--------------------+----------------------------------------------------------------------------------------
# |@CLASS|type |indexDefinition
----+------+--------------------+----------------------------------------------------------------------------------------
0 |null |NOTUNIQUE_HASH_INDEX|{className:Post,field:isFeatured,keyType:BOOLEAN,collate:default,nullValuesIgnored:true}
1 |null |NOTUNIQUE_HASH_INDEX|{className:User,field:isFeatured,keyType:BOOLEAN,collate:default,nullValuesIgnored:true}
2 |null |NOTUNIQUE_HASH_INDEX|{className:Tag,field:isFeatured,keyType:BOOLEAN,collate:default,nullValuesIgnored:true}
----+------+--------------------+----------------------------------------------------------------------------------------
3 item(s) found. Query executed in 0.037 sec(s).
orientdb {db=MYDB}> select from Post where isFeatured = true limit -1
----+---------+------+------+--------+--------+--------+---------+---------+------------+---------------+-----------------+---------------------------------------
# |@RID |@CLASS|type |in_Posts|in_Tags |in_Likes|isVisible|isFeature|in_SearchPos|out_PostComment|eventDate |tags
----+---------+------+------+--------+--------+--------+---------+---------+------------+---------------+-----------------+---------------------------------------
0 |#16:17...|Post |Search|[size=1]|[size=3]|[size=5]|true |true |[size=1] |[size=3] |2015-03-18 10:...|glassessunglasses earrings knitwear
1 |#16:17...|Post |Search|[size=1]|[size=3]|[size=5]|true |true |[size=1] |[size=3] |2015-03-18 10:...|necklaces lego like
2 |#16:17...|Post |Search|[size=1]|[size=3]|[size=5]|true |true |[size=1] |[size=3] |2015-03-18 10:...|cardigans inbonmarche sneakers
3 |#16:17...|Post |Search|[size=1]|[size=3]|[size=5]|true |true |[size=1] |[size=3] |2015-03-18 10:...|backpacks inspiration earrings
// ...
974 |#16:71...|Post |Search|[size=1]|[size=3]|[size=5]|true |true |[size=1] |[size=3] |2015-03-18 11:...|shirts businessrule knitwear
----+---------+------+------+--------+--------+--------+---------+---------+------------+---------------+-----------------+---------------------------------------
975 item(s) found. Query executed in 7.339 sec(s).
orientdb {db=MYDB}> select from User where isFeatured = true limit -1
----+---------+------+-----+------+------+------+-------+-------+--------+--------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
# |@RID |@CLASS|about|gender|status|market|website|devices|location|language|isPremium|birthDate|in_Events|out_Posts|out_Likes|username |name |isFeature|in_Follow|out_Event|isPowerUs|out_Follo|lastTipEm|out_Searc|out_Comme|shareSear|registrat|email |password |receivePr|picture
----+---------+------+-----+------+------+------+-------+-------+--------+--------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
0 |#11:92858|User |null |male |Active|null |null |null |null |null |false |null |[size=10]|[size=5] |[size=32]|user92859|user92859|true |[size=10]|[size=10]|false |[size=10]|0 |[size=5] |[size=17]|true |2015-0...|user92...|X6C/8f...|true |https:...
1 |#11:19...|User |null |male |Active|null |null |null |null |null |false |null |[size=10]|[size=5] |[size=28]|user19...|user19...|true |[size=10]|[size=10]|false |[size=10]|0 |[size=5] |[size=14]|true |2015-0...|user19...|dmwQIp...|true |https:...
2 |#11:69009|User |null |female|Active|null |null |null |null |null |false |null |[size=10]|[size=5] |[size=21]|user69010|user69010|true |[size=10]|[size=10]|false |[size=10]|0 |[size=5] |[size=10]|true |2015-0...|user69...|26BIti...|true |https:...
3 |#11:10118|User |null |male |Active|null |null |null |null |null |false |null |[size=10]|[size=5] |[size=27]|user10119|user10119|true |[size=10]|[size=10]|false |[size=10]|0 |[size=5] |[size=18]|true |2015-0...|user10...|Ts7KmY...|true |https:...
// ...
194 |#11:45655|User |null |male |Active|null |null |null |null |null |false |null |[size=10]|[size=5] |[size=30]|user45656|user45656|true |[size=10]|[size=10]|false |[size=10]|0 |[size=5] |[size=15]|true |2015-0...|user45...|KY8s98...|true |https:...
----+---------+------+-----+------+------+------+-------+-------+--------+--------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------
195 item(s) found. Query executed in 4.377 sec(s).
orientdb {db=MYDB}> select from Tag where isFeatured = true limit -1
----+------+------+---------------+----------+---------
# |@RID |@CLASS|name |isFeatured|out_Tags
----+------+------+---------------+----------+---------
0 |#29:12|Tag |shirts |true |[size=-1]
1 |#29:8 |Tag |shoes |true |[size=-1]
2 |#29:62|Tag |missoni |true |[size=-1]
3 |#29:52|Tag |hairaccessories|true |[size=-1]
----+------+------+---------------+----------+---------
4 item(s) found. Query executed in 25.81 sec(s).
orientdb {db=MYDB}>
orientdb {db=MYDB}> select count(*) from Post
----+------+-------
# |@CLASS|count
----+------+-------
0 |null |1000000
----+------+-------
1 item(s) found. Query executed in 0.023 sec(s).
orientdb {db=MYDB}>
orientdb {db=MYDB}> select count(*) from User
----+------+------
# |@CLASS|count
----+------+------
0 |null |200000
----+------+------
1 item(s) found. Query executed in 0.002 sec(s).
orientdb {db=MYDB}>
orientdb {db=MYDB}> select count(*) from Tag
----+------+-----
# |@CLASS|count
----+------+-----
0 |null |74
----+------+-----
1 item(s) found. Query executed in 0.002 sec(s).
orientdb {db=MYDB}> select from Post where isFeatured = true limit -1
// ...
975 item(s) found. Query executed in 1.239 sec(s).
orientdb {db=MYDB}> select from User where isFeatured = true limit -1
// ...
195 item(s) found. Query executed in 0.621 sec(s).
orientdb {db=MYDB}> select from Tag where isFeatured = true limit -1
// ...
4 item(s) found. Query executed in 5.873 sec(s).
orientdb {db=MYDB}> select from Post where isFeatured = true limit -1
// ...
975 item(s) found. Query executed in 0.653 sec(s).
orientdb {db=MYDB}> select from User where isFeatured = true limit -1
// ...
195 item(s) found. Query executed in 0.633 sec(s).
orientdb {db=MYDB}> select from Tag where isFeatured = true limit -1
// ...
4 item(s) found. Query executed in 6.051 sec(s).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment