Giter VIP home page Giter VIP logo

scalar-schemaを使ってパーティションキーあり、クラスタリーキーなし、セカンダリインデックスありの条件のテーブルをAmazon DynamoDBに登録したい about scalardb HOT 5 CLOSED

scalar-labs avatar scalar-labs commented on May 14, 2024
scalar-schemaを使ってパーティションキーあり、クラスタリーキーなし、セカンダリインデックスありの条件のテーブルをAmazon DynamoDBに登録したい

from scalardb.

Comments (5)

yito88 avatar yito88 commented on May 14, 2024 1

@scalar-kato Thank you for reporting this issue!

This error happened when a secondary index would be registered without clustering keys.
It was caused because the condition to make Attribute Definitions was wrong.
I've fixed it at #189.

By the way, I'm not sure why you want to use "BOOLEAN" as a secondary index type.
The query with the index would be too slow because it goes through all records to check deleted records.
For example, you can create a deleted table and insert the keys of records that you want to delete asynchronously.

from scalardb.

feeblefakie avatar feeblefakie commented on May 14, 2024

@scalar-kato

    "clustering-key": [
    ],

これを足してもだめですか?
( "clustering-key"のキーは必須です)

from scalardb.

scalar-kato avatar scalar-kato commented on May 14, 2024

@feeblefakie
提案いただいたjson形式で再度実行しましたが同様のエラーが発生しました。

from scalardb.

feeblefakie avatar feeblefakie commented on May 14, 2024

@scalar-kato I agree with @yito88.
I feel the schema needs to be re-designed.
Using a secondary index for low cardinality attribute is a bad practice in any databases since it will retrieve mos records. (For example, we have 1 million records and 300k records are marked as deleted then the secondary index access will retrieve the 300k records.)

from scalardb.

scalar-kato avatar scalar-kato commented on May 14, 2024

@yito88 @feeblefakie
Thank you for the response!
I now understand that secondary indexes should not be used for columns with low cardinality, and I will fix the DB schema in the future.

from scalardb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.