Skip to content

[BE] CUD 쿼리 정리

준팍(junpak) edited this page Sep 21, 2023 · 3 revisions

토픽

토픽 생성

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    insert 
    into
        topic
    values
        (?,?,?,?,?,?,?,?,?,?,default)

Latency : 0.112s, Query count : 3, Request URI : /topics/new

토픽 병합

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        topic t1_0 
    where
        t1_0.id in (?,?,?)
Hibernate: 
    select
        * 
    from
        pin p1_0 
    left join
        member c1_0 
            on c1_0.id=p1_0.member_id 
    left join
        location l1_0 
            on l1_0.id=p1_0.location_id 
    where
        p1_0.topic_id=?
Hibernate: 
    select
        * 
    from
        pin p1_0 
    left join
        member c1_0 
            on c1_0.id=p1_0.member_id 
    left join
        location l1_0 
            on l1_0.id=p1_0.location_id 
    where
        p1_0.topic_id=?
Hibernate: 
    select
        * 
    from
        pin p1_0 
    left join
        member c1_0 
            on c1_0.id=p1_0.member_id 
    left join
        location l1_0 
            on l1_0.id=p1_0.location_id 
    where
        p1_0.topic_id=?
Hibernate: 
    insert 
    into
        topic
    values
        (?,?,?,?,?,?,?,?,?,?,default)

Latency : 0.022s, Query count : 7, Request URI : /topics/merge

토픽 수정

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        topic t1_0 
    left join
        member c1_0 
            on c1_0.id=t1_0.member_id 
    where
        t1_0.id=?
Hibernate: 
    update
        topic 
    set
    where
        id=?

Latency : 0.019s, Query count : 4, Request URI : /topics/2

토픽 삭제

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        topic t1_0 
    left join
        member c1_0 
            on c1_0.id=t1_0.member_id 
    where
        t1_0.id=?
Hibernate: 
    update
        pin 
    set
        is_deleted=true 
    where
        topic_id=?
Hibernate: 
    update
        topic 
    set
        is_deleted=true 
    where
        id=?

Latency : 0.026s, Query count : 5, Request URI : /topics/2

핀 생성

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        topic t1_0 
    left join
        member c1_0 
            on c1_0.id=t1_0.member_id 
    where
        t1_0.id=?
Hibernate: 
    select
        * 
    from
        location l1_0 
    where
        (
            6371000*acos((((cos(radians(?))*cos(radians(l1_0.latitude)))*cos((radians(l1_0.longitude)-radians(?))))+(sin(radians(?))*sin(radians(l1_0.latitude)))))
        )<=?

Hibernate: 
    insert 
    into
        location
        (legal_dong_code,parcel_base_address,road_base_address,latitude,longitude,created_at,updated_at,id) 
    values
        (?,?,?,?,?,?,?,default)
Hibernate: 
    insert 
    into
        pin
        (created_at,member_id,is_deleted,location_id,description,name,topic_id,updated_at,id) 
    values
        (?,?,?,?,?,?,?,?,default)
Hibernate: 
    insert 
    into
        pin_image
        (created_at,image_url,is_deleted,pin_id,updated_at,id) 
    values
        (?,?,?,?,?,default)
Hibernate: 
    insert 
    into
        pin_image
        (created_at,image_url,is_deleted,pin_id,updated_at,id) 
    values
        (?,?,?,?,?,default)
Hibernate: 
    insert 
    into
        pin_image
        (created_at,image_url,is_deleted,pin_id,updated_at,id) 
    values
        (?,?,?,?,?,default)
Hibernate: 
    update
        topic 
    set
    where
        id=?

Latency : 0.04s, Query count : 10, Request URI : /pins
 경우에는 이미지를 3 넣은 경우임.

핀 이미지 추가

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        pin p1_0 
    left join
        member c1_0 
            on c1_0.id=p1_0.member_id 
    join
        location l1_0 
            on l1_0.id=p1_0.location_id 
    join
        topic t1_0 
            on t1_0.id=p1_0.topic_id 
    left join
        member c2_0 
            on c2_0.id=t1_0.member_id 
    where
        p1_0.id=?
Hibernate: 
    insert 
    into
        pin_image
    values
        (?,?,?,?,?,default)
Latency : 0.009s, Query count : 4, Request URI : /pins/images

핀 이미지 삭제

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        pin_image p1_0 
    left join
        pin p2_0 
            on p2_0.id=p1_0.pin_id 
    left join
        member c1_0 
            on c1_0.id=p2_0.member_id 
    left join
        location l1_0 
            on l1_0.id=p2_0.location_id 
    left join
        topic t1_0 
            on t1_0.id=p2_0.topic_id 
    left join
        member c2_0 
            on c2_0.id=t1_0.member_id 
    where
        p1_0.id=?
Hibernate: 
    update
        pin_image 
    set
        is_deleted=true 
    where
        id=?

Latency : 0.014s, Query count : 4, Request URI : /pins/images/1

권한

권한 부여

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        topic c1_0 
    where
        c1_0.member_id=?
Hibernate: 
    select
        * 
    from
        permission t1_0 
    left join
        topic t2_0 
            on t2_0.id=t1_0.topic_id 
    left join
        member c1_0 
            on c1_0.id=t2_0.member_id 
    where
        t1_0.member_id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id in (?)



Hibernate: 
    select
        p1_0.id 
    from
        permission p1_0 
    where
        p1_0.topic_id=? 
        and p1_0.member_id=? fetch first ? rows only


Hibernate: 
    insert 
    into
        permission
        (created_at,member_id,topic_id,updated_at,id) 
    values
        (?,?,?,?,default)

Latency : 0.049s, Query count : 7, Request URI : /permissions

권한 삭제

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        topic c1_0 
    where
        c1_0.member_id=?
Hibernate: 
    select
        * 
    from
        permission t1_0 
    left join
        topic t2_0 
            on t2_0.id=t1_0.topic_id 
    left join
        member c1_0 
            on c1_0.id=t2_0.member_id 
    where
        t1_0.member_id=?
Hibernate: 
    select
        * 
    from
        permission p1_0 
    join
        member m1_0 
            on m1_0.id=p1_0.member_id 
    join
        topic t1_0 
            on t1_0.id=p1_0.topic_id 
    left join
        member c1_0 
            on c1_0.id=t1_0.member_id 
    where
        p1_0.id=?
Hibernate: 
    delete 
    from
        permission 
    where
        id=?

Latency : 0.108s, Query count : 6, Request URI : /permissions/1

즐겨찾기

즐겨찾기 추가

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        topic c1_0 
    where
        c1_0.member_id=?
Hibernate: 
    select
        * 
    from
        permission t1_0 
    left join
        topic t2_0 
            on t2_0.id=t1_0.topic_id 
    left join
        member c1_0 
            on c1_0.id=t2_0.member_id 
    where
        t1_0.member_id=?
Hibernate: 
    select
        b1_0.id 
    from
        bookmark b1_0 
    where
        b1_0.member_id=? 
        and b1_0.topic_id=? fetch first ? rows only
Hibernate: 
    insert 
    into
        bookmark
        (member_id,topic_id,id) 
    values
        (?,?,default)

Latency : 0.013s, Query count : 6, Request URI : /bookmarks/topics

즐겨찾기 삭제

Hibernate: 
    select
        count(*) 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        member m1_0 
    where
        m1_0.id=?
Hibernate: 
    select
        * 
    from
        topic c1_0 
    where
        c1_0.member_id=?
Hibernate: 
    select
        * 
    from
        permission t1_0 
    left join
        topic t2_0 
            on t2_0.id=t1_0.topic_id 
    left join
        member c1_0 
            on c1_0.id=t2_0.member_id 
    where
        t1_0.member_id=?
Hibernate: 
    select
        b1_0.id 
    from
        bookmark b1_0 
    where
        b1_0.member_id=? 
        and b1_0.topic_id=? fetch first ? rows only
Hibernate: 
    select
        b1_0.id,
        b1_0.member_id,
        b1_0.topic_id 
    from
        bookmark b1_0 
    where
        b1_0.member_id=? 
        and b1_0.topic_id=?
Hibernate: 
    delete 
    from
        bookmark 
    where
        id=?

Latency : 0.114s, Query count : 7, Request URI : /bookmarks/topics