9. A computer system for generating at least one of a serializer and a deserializer for compiling a query, the computer system comprising: one or more computer processors; one or more computer readable storage media; and program instructions stored on the computer readable storage media for execution by at least one of the one or more processors, the program instructions comprising: program instructions to infer a type of serialization for each generation site of compiling a query; program instructions to execute the inferred type of serialization, while transcribing identification information assigned to each generation site to a type as an annotation; program instructions to specialize a serializer for each generation site, based on the inferred type of serialization and a type of serialization that is actually used at a generation site; program instructions to recursively compare the inferred type of serialization and the type of serialization that is actually used at a generation site; and program instructions to serialize a data value using the specialized serializer for each generation site.
9. A computer system for generating at least one of a serializer and a deserializer for compiling a query, the computer system comprising: one or more computer processors; one or more computer readable storage media; and program instructions stored on the computer readable storage media for execution by at least one of the one or more processors, the program instructions comprising: program instructions to infer a type of serialization for each generation site of compiling a query; program instructions to execute the inferred type of serialization, while transcribing identification information assigned to each generation site to a type as an annotation; program instructions to specialize a serializer for each generation site, based on the inferred type of serialization and a type of serialization that is actually used at a generation site; program instructions to recursively compare the inferred type of serialization and the type of serialization that is actually used at a generation site; and program instructions to serialize a data value using the specialized serializer for each generation site. 12. The computer system of claim 9 , wherein in a case of generating a serializer of a record type having an optional area, program instructions to specialize a serializer for each generation site comprise program instructions to: in response to determining that an optional area in a first type is already requested in a second type, generate code for outputting a bit indicating “1”; in response to determining that the optional area in the first type is not present in the second type, generate code for outputting a bit indicating “0”; and in response to determining that the optional area in the first type is also an optional area in the second type, generate code for outputting a bit indicating “1” if a data value is present, and generate code for outputting a bit indicating “0” if no data value is present.