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

Document SQL fast paths #3511

Closed
emsal0 opened this issue Aug 7, 2018 · 9 comments
Closed

Document SQL fast paths #3511

emsal0 opened this issue Aug 7, 2018 · 9 comments
Assignees
Milestone

Comments

@emsal0
Copy link

emsal0 commented Aug 7, 2018

There are a number of conditions that trigger fast paths during execution that are faster than the normal operation. For example, if rows can be deleted without actually having to scan them, then cockroach will undergo an alternative 'fast delete'. (see canDeleteFast and fastDelete in delete.go)

Documenting these fast paths is important to users so they can know in what ways they can boost the performance of their queries.

@awoods187
Copy link
Contributor

CC @rmloveland this will be a late add (and priority for 2.1 in particular) due to work @emsal1863 has done to make a fast path for interleave deletes for customers like C and others. His work is close to merging but there are a few other fast paths that are useful to document at the same time

@awoods187 awoods187 added this to the 2.1 milestone Aug 7, 2018
@rmloveland
Copy link
Contributor

@emsal1863 do you have a link to an example of such a query or queries? (for example in tests attached to a code PR?)

@rmloveland
Copy link
Contributor

Looks like cockroachdb/cockroach#28330

@BramGruneir
Copy link
Member

@emsal1863, can you please write out an example for each fastpath and how to activate it?

@emsal0
Copy link
Author

emsal0 commented Aug 21, 2018

Interleaved fast path (cockroachdb/cockroach#28330)

This fast path is triggered when issuing a DELETE statement on a table with interleaved tables that all have ON DELETE CASCADE clauses, have no secondary indices, and aren't foreign key-referenced by any other table. The path is not taken when there is any RETURNING claus in the delete query. When triggered, the delete operation will skip the expensive foreign key check operations, instead opting for using KV DelRange requests to delete all of the keys necessary.

The performance boost from using this fast path is several orders of magnitude, potentially going from second-scale to sub-nanosecond scale.

@jseldess jseldess added the A-sql label Oct 3, 2018
rmloveland added a commit that referenced this issue Oct 4, 2018
Addresses #3511.

Summary of changes:

- Update 'INTERLEAVE IN PARENT' page with:

  - Some new paragraphs in the **Benefits** explaining fast path deletes
  - A new example in the **Examples** section
  - A reference to the above from the **Tradeoffs** section
  - (Unrelated) Some `div` tags to fix a broken diagram
rmloveland added a commit that referenced this issue Oct 8, 2018
Addresses #3511.

Summary of changes:

- Update 'INTERLEAVE IN PARENT' page with:

  - Some new paragraphs in the **Benefits** explaining fast path deletes
  - A new example in the **Examples** section
  - A reference to the above from the **Tradeoffs** section
  - (Unrelated) Add `div` tags to fix a broken diagram
rmloveland added a commit that referenced this issue Oct 8, 2018
Addresses #3511.

Summary of changes:

- Update 'INTERLEAVE IN PARENT' page with:

  - Some new paragraphs in the **Benefits** explaining fast path deletes
  - A new example in the **Examples** section
  - A reference to the above from the **Tradeoffs** section
  - (Unrelated) Add `div` tags to fix a broken diagram
rmloveland added a commit that referenced this issue Oct 10, 2018
Addresses #3511.

Summary of changes:

- Update 'INTERLEAVE IN PARENT' page with:

  - Some new paragraphs in the **Benefits** explaining fast path deletes
  - A new example in the **Examples** section
  - A reference to the above from the **Tradeoffs** section
  - (Unrelated) Add `div` tags to fix a broken diagram
rmloveland added a commit that referenced this issue Oct 10, 2018
Addresses #3511.

Summary of changes:

- Update 'INTERLEAVE IN PARENT' page with:

  - Some new paragraphs in the **Benefits** explaining fast path deletes
  - A new example in the **Examples** section
  - A reference to the above from the **Tradeoffs** section
  - (Unrelated) Add `div` tags to fix a broken diagram
rmloveland added a commit that referenced this issue Oct 10, 2018
Addresses #3511.

Summary of changes:

- Update 'INTERLEAVE IN PARENT' page with:

  - Some new paragraphs in the **Benefits** explaining fast path deletes
  - A new example in the **Examples** section
  - A reference to the above from the **Tradeoffs** section
  - (Unrelated) Add `div` tags to fix a broken diagram
@jseldess
Copy link
Contributor

jseldess commented Nov 9, 2018

@rmloveland, what's left here after #3834?

@rmloveland
Copy link
Contributor

@knz I recall that there are some other fast paths that you created diagrams for. Are the other fast path operations in a state that we would want to document them at this time?

@rmloveland
Copy link
Contributor

@BramGruneir or @knz : can this issue be closed now that fast path deletes are documented?

I recall that there are some other fast paths, but IIRC we do not want to document the others yet. Is that correct?

@BramGruneir
Copy link
Member

Yep, I say close it.

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

No branches or pull requests

5 participants