Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on demo website runs into out of time #80

Open
matthiastz opened this issue Dec 20, 2019 · 2 comments
Open

Test on demo website runs into out of time #80

matthiastz opened this issue Dec 20, 2019 · 2 comments
Labels

Comments

@matthiastz
Copy link

setup:
schema AlbumSchema(AlbumId: int, Title: varchar, ArtistId: int);
table Album(AlbumSchema);

query q1 -- define query q1
SELECT * FROM Album a;

query q2 -- define query q1
SELECT a.AlbumId, a.Title, a.ArtistId FROM Album a;

verify q1 q2; -- does q1 equal to q2?

result:
Two queries' equivalence is unknown. Solver runs out of time.

@stechu stechu added the bug label Dec 21, 2019
@stechu
Copy link
Contributor

stechu commented Dec 21, 2019

Thanks for the report. This looks like an edge case in prover code gen.

@matthiastz
Copy link
Author

matthiastz commented Dec 23, 2019

While working with Cosette I found more cases where the solver runs into out of time. Maybe that is of interest for you:

redundant sql clauses

schema TrackSchema(TrackId: int, Name: varchar, AlbumId: int,
                MediaTypeId: int, GenreId: int, Composer: varchar,
                Milliseconds: int, Bytes: int, UnitPrice: numeric);
table Track(TrackSchema);

query q1
`SELECT tr.Name, tr.MediaTypeId FROM Track tr WHERE tr.MediaTypeId > 2`;

query q2
`SELECT tr.Name, tr.MediaTypeId FROM Track tr WHERE tr.MediaTypeId > 2 and tr.MediaTypeId > 1`;

verify q1 q2;

joins

schema TrackSchema(TrackId: int, Name: varchar, AlbumId: int,
                MediaTypeId: int, GenreId: int, Composer: varchar,
                Milliseconds: int, Bytes: int, UnitPrice: numeric);
table Track(TrackSchema);
schema MediaTypeSchema(MediaTypeId: int, Name: varchar); 
table MediaType(MediaTypeSchema);

query q1
`select tr.TrackId, tr.Name, tr.Composer from Track tr
join (select mt.MediaTypeId,  mt.Name from MediaType mt where mt.Name = 'AAC audio file')
as tMediaType ON tr.MediaTypeId = tMediaType.MediaTypeId`;

query q2
`select tr.TrackId, tr.Name, tr.Composer  from Track tr
join MediaType mt
ON tr.MediaTypeId = mt.MediaTypeId
WHERE mt.Name = 'AAC audio file'`;

verify q1 q2;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants