Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1955 SELECT .. FETCHPLAN doesn't work in binary protocol #2037

Merged
merged 1 commit into from
Feb 12, 2014

Conversation

kowalot
Copy link
Contributor

@kowalot kowalot commented Feb 12, 2014

It fixes #1955. After change, FETCHPLAN works with binary protocol on two levels

  • COMMAND level - defined in COMMAND payload
  • SQL SELECT with FETCHPLAN clause

If both are defined SQL FETCHPLAN overrides COMMAND fetch plan.

Since now
SELECT FROM V WHERE name="HEY BO DIDDLEY" FETCHPLAN "*:1"
returns via binary protocol expected
#9:1 v25 V@name:"HEY BO DIDDLEY",song_type:"cover",performances:5,type:"song",out_followed_by:%AQAAAAUACwAAAAAAAAAAAAsAAAAAAAAAAQALAAAAAAAAAAIACwAAAAAAAAADAAsAAAAAAAAABA==;,out_written_by:#9:7,out_sung_by:#9:8,in_followed_by:%AQAAAAQACwAAAAAAAAAKAAsAAAAAAAAAlgALAAAAAAAAChIACwAAAAAAABXG;

-------------- PREFETCHED ---------
#9:7 v19 V@in_written_by:%AQAAAAkACQAAAAAAAAABAAkAAAAAAAAABgAJAAAAAAAAAXEACQAAAAAAAAJDAAkAAAAAAAACQwAJAAAAAAAAAosACQAAAAAAAALJAAkAAAAAAAAC7QAJAAAAAAAAAyM=;,in_sung_by:%AQAAAAcACQAAAAAAAAJDAAkAAAAAAAACQwAJAAAAAAAAAosACQAAAAAAAALJAAkAAAAAAAAC7QAJAAAAAAAAAvwACQAAAAAAAAMj;,name:"Bo_Diddley",type:"artist"
#9:8 v153 V@in_sung_by:%AAAAAAAAAAAcAAAAAAAAAAAAAIAAAAAAkgAAAAA=;,in_written_by:%AQAAAAQACQAAAAAAAAD0AAkAAAAAAAABzQAJAAAAAAAAAdEACQAAAAAAAAHu;,name:"Garcia",type:"artist"
#11:0 v2 followed_by@out:#9:1,in:#9:2,weight:1
#11:1 v2 followed_by@out:#9:1,in:#9:3,weight:2
#11:2 v2 followed_by@out:#9:1,in:#9:4,weight:1
#11:3 v2 followed_by@out:#9:1,in:#9:5,weight:1
#11:4 v2 followed_by@out:#9:1,in:#9:6,weight:1
#11:10 v2 followed_by@out:#9:3,in:#9:1,weight:2
#11:150 v2 followed_by@out:#9:5,in:#9:1,weight:2
#11:2578 v2 followed_by@out:#9:49,in:#9:1,weight:1
#11:5574 v2 followed_by@out:#9:25,in:#9:1,weight:1

@kowalot
Copy link
Contributor Author

kowalot commented Feb 12, 2014

Tests passed

@lvca lvca added the bug label Feb 12, 2014
@lvca lvca self-assigned this Feb 12, 2014
@lvca lvca added this to the 1.7rc2 milestone Feb 12, 2014
@lvca
Copy link
Member

lvca commented Feb 12, 2014

What about if you specify:

SELECT FROM V WHERE name="HEY BO DIDDLEY" FETCHPLAN "*:1"

and then you set to NULL the fetchplan in command instance, what to use? With your patch the NULL replaces the fetchplan in SQL command, but often users want just to use SQL because it's simpler. WDYT?

@kowalot
Copy link
Contributor Author

kowalot commented Feb 12, 2014

Actually it's opposite.I hope my description describes it correctly. SELECT FETCHPLAN has always priority, so NULL has no impact.
This is good for instance for Query tools, because everyting can be defined in SQL, no matter what is defined at binary COMMAND level which is sent by the tool itself.

So if you have ":0" on binary COMMAND level, the SQL statement
SELECT FROM V WHERE name="HEY BO DIDDLEY" FETCHPLAN "
*:1"
still will generate prefetched records.

lvca added a commit that referenced this pull request Feb 12, 2014
#1955 SELECT .. FETCHPLAN doesn't work in binary protocol
@lvca lvca merged commit ec320cc into orientechnologies:develop Feb 12, 2014
@lvca
Copy link
Member

lvca commented Feb 12, 2014

Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

SELECT .. FETCHPLAN doesn't work in binary protocol
2 participants