rafsun42 commented on code in PR #1252: URL: https://github.com/apache/age/pull/1252#discussion_r1357437770
########## src/include/utils/agtype_raw.h: ########## @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * This module provides functions for directly building agtype + * without using agtype_value. + */ + +#ifndef AG_AGTYPE_RAW_H +#define AG_AGTYPE_RAw_H + +#include "postgres.h" +#include "utils/agtype.h" +#include "utils/agtype_ext.h" + +/* + * Used for building an agtype container. + */ +typedef struct agtype_build_state Review Comment: @jrgemignani There is another way to do this. Currently, `push_agtype_value` unpacks binary inputs. For the case of `_agtype_build_vertex`, unpacking basically leads to conversion between `agtype` and `agtype_value` back and forth. We can provide options to not unpack, instead add the binary as it is. I tried it before working on this PR. You can see the [branch](https://github.com/apache/age/compare/master...rafsun42:age:feat_push_agtype_binary) here if you have time. However, that is slightly slower than this PR. Original took 52s, the branch in the link took 19s, and this PR took 10s when _agtype_build_vertex is called on 10mil rows. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
