Skip to content

Improve query when getting consuming GET /api/records #125

@mcruzdev

Description

@mcruzdev

Actually the query log is:

[Hibernate] 
    select
        count(*) 
    from
        records r1_0 
    where
        r1_0.userId=?

[Hibernate] 
    select
        r1_0.id,
        r1_0.amount,
        r1_0.category,
        r1_0.createdAt,
        r1_0.description,
        r1_0.transaction,
        r1_0.userId 
    from
        records r1_0 
    where
        r1_0.userId=? 
    offset
        ? rows 
    fetch
        first ? rows only

[Hibernate] 
    select
        r1_0.id,
        r1_0.amount,
        r1_0.category,
        r1_0.createdAt,
        r1_0.description,
        r1_0.transaction,
        r1_0.userId 
    from
        records r1_0 
    where
        r1_0.userId=? 
        and r1_0.createdAt>=? 
        and r1_0.createdAt<=?

It would be great if we have it in a unique select.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions