Skip to content

SchemaCache dosen't work  #6473

Closed
Closed
@JeffGuKang

Description

@JeffGuKang

Issue Description

CREATE TABLE IF NOT EXISTS "_SCHEMA" ( "className" varChar(120), "schema" jsonb, "isParseClass" bool, PRIMARY KEY ("className") )

called continually. with SELECT * FROM "_SCHEMA"

image

And DB Connection increased also.

I found this query from the parse server source

I am not sure why this happens and what is wrong with my code. So I shared my issue.

Query log

...
2020-03-07 09:55:08.372 KST [40465] LOG:  duration: 0.151 ms  statement: SELECT * FROM "_SCHEMA"
2020-03-07 09:55:08.373 KST [40465] LOG:  duration: 0.184 ms  statement: SELECT * FROM "Info" WHERE "objectId" = 'Ap9l9l0enC' AND ("_rperm" IS NULL OR "_rperm" && ARRAY['*','*','xO7kxBDsZO'])   
2020-03-07 09:55:08.374 KST [40465] LOG:  duration: 0.040 ms  statement: CREATE TABLE IF NOT EXISTS "_SCHEMA" ( "className" varChar(120), "schema" jsonb, "isParseClass" bool, PRIMARY KEY ("className") )
2020-03-07 09:55:08.375 KST [40465] LOG:  duration: 0.140 ms  statement: SELECT * FROM "_SCHEMA"
2020-03-07 09:55:08.376 KST [40465] LOG:  duration: 0.092 ms  statement: SELECT * FROM "Info" WHERE "objectId" = 'Ap9l9l0enC'   
2020-03-07 09:55:08.380 KST [40465] LOG:  duration: 0.068 ms  statement: CREATE TABLE IF NOT EXISTS "_SCHEMA" ( "className" varChar(120), "schema" jsonb, "isParseClass" bool, PRIMARY KEY ("className") )
2020-03-07 09:55:08.381 KST [40465] LOG:  duration: 0.158 ms  statement: SELECT * FROM "_SCHEMA"
2020-03-07 09:55:08.382 KST [40465] LOG:  duration: 0.103 ms  statement: SELECT * FROM "Photo" WHERE "objectId" = 'eGvqdUDF7h'   
...

Steps to reproduce

PostgreSQL RDS <=> EC2 Parse Server with LiveQuery
Redis <=>

I am using Parse.Object.registerSubclass Parse Classes as below.

interface PetParams {
...
}

export class Pet extends Parse.Object<PetParams> {
  constructor(params?: PetParams) {
    super('Pet', params) 
  }

  deleteSelf = (id, options: Parse.Object.DestroyOptions) => {
    this.id = id

    return this.destroy(options)
  }
}

Expected Results

Do not call SELECT * FROM "_SCHEMA" query continually

Actual Outcome

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : [4.0.1]
    • Operating System: [Node.js running on 64bit Amazon Linux/4.13.0]
    • Hardware: []
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [AWS]
  • Database

    • PostgreSQL version: [11.4 ~ 11.5]
    • Storage engine: [RDS, Redis]
    • Hardware: []
    • Localhost or remote server? (AWS): [AWS]

Logs/Trace

No Parse log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions