Query Generation based on Generative Adversarial Networks

03/26/2023
by   Weihua Sun, et al.
0

Many problems in database systems, such as cardinality estimation, database testing and optimizer tuning, require a large query load as data. However, it is often difficult to obtain a large number of real queries from users due to user privacy restrictions or low frequency of database access. Query generation is one of the approaches to solve this problem. Existing query generation methods, such as random generation and template-based generation, do not consider the relationship between the generated queries and existing queries, or even generate semantically incorrect queries. In this paper, we propose a query generation framework based on generative adversarial networks (GAN) to generate query load that is similar to the given query load. In our framework, we use a syntax parser to transform the query into a parse tree and traverse the tree to obtain the sequence of production rules corresponding to the query. The generator of GAN takes a fixed distribution prior as input and outputs the query sequence, and the discriminator takes the real query and the fake query generated by the generator as input and outputs a gradient to guide the generator learning. In addition, we add context-free grammar and semantic rules to the generation process, which ensures that the generated queries are syntactically and semantically correct. We conduct experiments to evaluate our approach on real-world dataset, which show that our approach can generate new query loads with a similar distribution to a given query load, and that the generated queries are syntactically correct with no semantic errors. The generated query loads are used in downstream task, and the results show a significant improvement in the models trained with the expanded query loads using our approach.

READ FULL TEXT
research
08/22/2018

TreeGAN: Syntax-Aware Sequence Generation with Generative Adversarial Networks

Generative Adversarial Networks (GANs) have shown great capacity on imag...
research
12/30/2022

Modified Query Expansion Through Generative Adversarial Networks for Information Extraction in E-Commerce

This work addresses an alternative approach for query expansion (QE) usi...
research
08/16/2018

Improving Conditional Sequence Generative Adversarial Networks by Stepwise Evaluation

Sequence generative adversarial networks (SeqGAN) have been used to impr...
research
09/24/2019

Keyphrase Generation for Scientific Articles using GANs

In this paper, we present a keyphrase generation approach using conditio...
research
06/18/2021

World-GAN: a Generative Model for Minecraft Worlds

This work introduces World-GAN, the first method to perform data-driven ...
research
02/12/2020

Real or Not Real, that is the Question

While generative adversarial networks (GAN) have been widely adopted in ...
research
10/28/2019

Applications of Generative Adversarial Models in Visual Search Reformulation

Query reformulation is the process by which a input search query is refi...

Please sign up or login with your details

Forgot password? Click here to reset