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

EXISTS Freezes #63

Open
vinvsv97 opened this issue May 1, 2018 · 1 comment
Open

EXISTS Freezes #63

vinvsv97 opened this issue May 1, 2018 · 1 comment

Comments

@vinvsv97
Copy link

vinvsv97 commented May 1, 2018

When I ran cosette to check query that uses EXISTS in its WHERE caluse, cosette freezes. A similar query using IN in its WHERE clause works perfectly. Query 1 below works fine but query 2 freezes

schema sch_flights(fid:int,
    year:int,
	month_id:int,
	day_of_month:int,
	day_of_week_id:int,
	carrier_id:string,
	flight_num:int,
	origin_city:string,
	origin_state:string,
	dest_city:string,
	dest_state:string,
	departure_delay:int,
	taxi_out:int,
	arrival_delay:int,
	canceled:int,
	actual_time:int,
	distance:int,
	capacity:int,
	price:int
);

schema sch_carriers
(
	cid:int,
	name:string
);

SCHEMA sch_months
(
	mid:int,
	month:string
);

SCHEMA sch_weekdays
(
	did:int,
	day_of_week:string
);

table Flights(sch_flights);
table Carriers(sch_carriers);
table Weekdays(sch_weekdays);
table Months(sch_months);
query q1                -- define query q1 on tables a and b
 select distinct C.name as carrier
 from Carriers C
 where C.cid in (select F.carrier_id as carrier_id
                          from Flights F
                          where F.origin_city = 'Seattle WA' and 
                            F.dest_city = 'San Francisco CA' and
                            F.carrier_id = C.cid);

query q2                -- define query q2 likewise
 SELECT DISTINCT c.name AS carrier
 FROM Carriers AS c
 WHERE EXISTS ( SELECT *
	                      FROM flights AS f
	                      WHERE f.carrier_id = c.cid
		              AND f.origin_city = 'Seattle WA'
		              AND f.dest_city = 'San Francisco CA');

@stechu
Copy link
Contributor

stechu commented May 3, 2018

@vinvsv97 we hear you. This is a known issue. Unfortunately, I don't have any cycle right now. Will fix it after May 15th.

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

No branches or pull requests

2 participants