Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EXISTS with subquery runs into out of time #83

@matthiastz

Description

@matthiastz

setup:

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

query q1
`SELECT t.TrackId, t.Name, t.GenreId 
FROM Track t
WHERE EXISTS
(SELECT g.GenreId FROM Genre g WHERE t.GenreId = g.GenreId AND (g.Name = 'Reggae' OR g.Name = 'Jazz'))`;

query q2
`SELECT t.TrackId, t.Name, t.GenreId 
FROM Track t
WHERE EXISTS
(SELECT g.GenreId FROM Genre g WHERE t.GenreId = g.GenreId AND g.Name = 'Reggae' OR g.Name = 'Jazz')`;

verify q1 q2;

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions