Skip to content

[64pt] Indexes: inconsistent and poor information about indexes #1691

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

Closed
Onvember opened this issue Dec 11, 2020 · 2 comments
Closed

[64pt] Indexes: inconsistent and poor information about indexes #1691

Onvember opened this issue Dec 11, 2020 · 2 comments
Assignees
Labels
add details [nature] More details needed, some info missing. Documentation is incomplete. user_guide [location] Tarantool manual, User's Guide part

Comments

@Onvember
Copy link
Contributor

Onvember commented Dec 11, 2020

[From mopinion]

Информация по индексам сейчас разбита на несколько частей и её приходится искать по разным местам и это очень неудобно. Есть также 2 раздела (Модель данных->Индексы и CRUD operations -> Индекс), кажется что их можно было бы слить в один. На общей странице про индексы очень не хватает детальной информации:

  1. какие бывают типы индексов
  2. ограничения для каждого типа (какой движок поддерживает, какие допустимы типы данных, требуется ли уникальность, требуется ли нуллабельность)
  3. как работать с многокомпонентными индексами.
  4. чуть чуть тех деталей - какой индекс для каких сценариев лучше.

Источник: Монс

Обязательно надо добавить то что индекс HASH требует уникальность полей и в современных приложениях его лучше не использовать, т.к. он почти по всем параметрам проигрывает TREE. HASH присутствует сейчас в тарантуле в основном из-за backward compatibility.

Не используйте индекс HASH:

  • просто так
  • "потому что hash быстрее" (без перф-замера)
  • для первичного ключа
  • в качестве единственного индекса
  • если хотите итерироваться по данным

Используйте HASH:

  • Если это вторичный ключ
  • Вам 100% не потребуется снять с него уникальность
  • Вам ОЧЕНЬ нужны эти 2-5% перфа
  • Вы провели замеры на ваших данных и вы видите этот прирост перфа
  • Вы экономите каждый байт на тапле (хэши чуть-чуть компактнее)

https://www.tarantool.io/en/doc/1.10/book/box/indexes/
https://www.tarantool.io/en/doc/1.10/book/box/data_model/#indexes

@Onvember Onvember added user_guide [location] Tarantool manual, User's Guide part M (medium) add details [nature] More details needed, some info missing. Documentation is incomplete. labels Dec 11, 2020
@NickVolynkin
Copy link
Contributor

@akudiyar and @vrogach2020 have a few good ideas and requests about documenting indexes. Guys, please share them with @Onvember.

@artur-barsegyan
Copy link
Contributor

@Onvember I have seen your document with task analysis.

I think that you need to write a draft for this page and show me and @Mons on review.
That page is important and needs to review with product-managers.

@Onvember Onvember changed the title [20pt] mopinion: inconsistent and poor information about indexes [64pt] mopinion: inconsistent and poor information about indexes Feb 24, 2021
@Onvember Onvember changed the title [64pt] mopinion: inconsistent and poor information about indexes [64pt] Indexes: inconsistent and poor information about indexes Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add details [nature] More details needed, some info missing. Documentation is incomplete. user_guide [location] Tarantool manual, User's Guide part
Projects
None yet
Development

No branches or pull requests

3 participants