data 3

PostgreSQL의 인덱스 | btree vs brin

1. 왜 이 글을 쓰게 되었나요?2. 성능 테스트3. 샘플 데이터 정보 1. 왜 이 글을 쓰게 되었나요?쿼리 튜닝을 위해 인덱스를 생성하는 일은 개발하면서 자주 접하게 됩니다.그런데 최근 증분 데이터를 다른 시스템(Redshift 등)으로 옮길 때도 인덱스를 활용할 수 있다는 사실을 알게 되었습니다.그리고 우리가 평소에 사용하던 인덱스는 어떤 역할을 하는지 궁금해졌고,정리하는 마음으로 이 글을 작성하게 되었습니다. BTREE (Balanced Tree) 인덱스Postgres의 기본 인덱스 타입입니다. CREATE INDEX idx_parcel_tracking_customer_name ON parcel_tracking (customer_name); 요 쿼리를 수행 했을 때 생성되는 인덱스입니다.값을 정렬된..

DB 2025.07.07

Airflow query csv export, 쿼리로 csv export

공식문서를 기반으로 만들었다. https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/hooks/dbapi/index.html#airflow.hooks.dbapi.DbApiHook.get_pandas_df 아래 내용을 토대로 만들었다. https://pepega.tistory.com/49 전체 코드는 아래에 있다. https://github.com/GHGHGHKO/airflow/commit/7509b3c13816629c450afc8f8a325143c1da1d65 기존에는 get_records 메서드를 활용했다. def execute(self, context): hook = PostgresHook( postgres_conn_id = self...

Airflow 2022.03.20

Airflow 메일 전송, EmailOperator, SMTP, Gmail

airflow.cfg EmailOperator Gmail 활용하였다. 관련 코드 https://github.com/GHGHGHKO/airflow/blob/master/dags/mail_test.py airflow.cfg [smtp] 설정 문서 https://airflow.apache.org/docs/apache-airflow/stable/configurations-ref.html#config-smtp EmailOperator https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/operators/email/index.html Gmail SMTP 활용 https://support.google.com/mail/answer/7126229?hl=..

Airflow 2022.03.15