-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Improve the UX by un-quoting the individual *.sql files and moving the `bench()` call to index.sql. - Include the *.sql filename in the output CSV. - Make psql stop on the first error.
- Loading branch information
Showing
23 changed files
with
125 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
SELECT * from bench( | ||
'SELECT count(*) | ||
SELECT count(*) | ||
FROM arrivals_departures | ||
WHERE stop_id = ''definitely-non-existent''' | ||
); | ||
WHERE stop_id = 'definitely-non-existent' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM arrivals_departures | ||
WHERE route_short_name = ''S1'' | ||
AND t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02'') | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02'')' | ||
); | ||
WHERE route_short_name = 'S1' | ||
AND t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02') | ||
AND date <= dates_filter_max('2022-08-09T07:30+02') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM arrivals_departures | ||
WHERE station_id = ''de:11000:900100001'' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02'') | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02'')', | ||
40 | ||
); | ||
WHERE station_id = 'de:11000:900100001' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02') | ||
AND date <= dates_filter_max('2022-08-09T07:30+02') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM arrivals_departures | ||
WHERE station_id = ''de:11000:900100001'' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02'') | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02'') | ||
AND stop_sequence = 0', | ||
50 | ||
); | ||
WHERE station_id = 'de:11000:900100001' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02') | ||
AND date <= dates_filter_max('2022-08-09T07:30+02') | ||
AND stop_sequence = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
SELECT * from bench( | ||
'SELECT count(*) | ||
SELECT count(*) | ||
FROM arrivals_departures | ||
WHERE stop_id = ''de:11000:900100001::4'' -- S+U Friedrichstr. (Berlin)' | ||
); | ||
WHERE stop_id = 'de:11000:900100001::4' -- S+U Friedrichstr. (Berlin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM arrivals_departures | ||
WHERE stop_id = ''de:11000:900100001::4'' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02'') | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02'')' | ||
); | ||
WHERE stop_id = 'de:11000:900100001::4' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02') | ||
AND date <= dates_filter_max('2022-08-09T07:30+02') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM arrivals_departures | ||
WHERE t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02''::timestamp with time zone) | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02''::timestamp with time zone)', | ||
10 | ||
); | ||
WHERE t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02'::timestamp with time zone) | ||
AND date <= dates_filter_max('2022-08-09T07:30+02'::timestamp with time zone) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM arrivals_departures | ||
WHERE t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= ''2022-08-08'' | ||
AND date <= ''2022-08-09''', | ||
10 | ||
); | ||
WHERE t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= '2022-08-08' | ||
AND date <= '2022-08-09' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM arrivals_departures | ||
WHERE trip_id = ''168977951'' | ||
AND date > ''2022-08-08'' AND date <= ''2022-08-09''' | ||
); | ||
WHERE trip_id = '168977951' | ||
AND date > '2022-08-08' AND date <= '2022-08-09' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
SELECT * from bench( | ||
'SELECT count(*) | ||
SELECT count(*) | ||
FROM connections | ||
WHERE from_stop_id = ''definitely-non-existent''' | ||
); | ||
WHERE from_stop_id = 'definitely-non-existent' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM connections | ||
WHERE route_short_name = ''S1'' | ||
AND t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02'') | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02'')' | ||
); | ||
WHERE route_short_name = 'S1' | ||
AND t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02') | ||
AND date <= dates_filter_max('2022-08-09T07:30+02') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM connections | ||
WHERE from_station_id = ''de:11000:900100001'' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02'') | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02'')', | ||
40 | ||
); | ||
WHERE from_station_id = 'de:11000:900100001' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02') | ||
AND date <= dates_filter_max('2022-08-09T07:30+02') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM connections | ||
WHERE from_station_id = ''de:11000:900100001'' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02'') | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02'') | ||
AND from_stop_sequence = 0', | ||
50 | ||
); | ||
WHERE from_station_id = 'de:11000:900100001' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02') | ||
AND date <= dates_filter_max('2022-08-09T07:30+02') | ||
AND from_stop_sequence = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
SELECT * from bench( | ||
'SELECT count(*) | ||
SELECT count(*) | ||
FROM connections | ||
WHERE from_stop_id = ''de:11000:900100001::4'' -- S+U Friedrichstr. (Berlin)' | ||
); | ||
WHERE from_stop_id = 'de:11000:900100001::4' -- S+U Friedrichstr. (Berlin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM connections | ||
WHERE from_stop_id = ''de:11000:900100001::4'' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02'') | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02'')' | ||
); | ||
WHERE from_stop_id = 'de:11000:900100001::4' -- S+U Friedrichstr. (Berlin) | ||
AND t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02') | ||
AND date <= dates_filter_max('2022-08-09T07:30+02') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM connections | ||
WHERE t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= dates_filter_min(''2022-08-09T07:10+02''::timestamp with time zone) | ||
AND date <= dates_filter_max(''2022-08-09T07:30+02''::timestamp with time zone) | ||
WHERE t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= dates_filter_min('2022-08-09T07:10+02'::timestamp with time zone) | ||
AND date <= dates_filter_max('2022-08-09T07:30+02'::timestamp with time zone) | ||
ORDER BY t_departure | ||
LIMIT 100', | ||
7 | ||
); | ||
LIMIT 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM connections | ||
WHERE t_departure >= ''2022-08-09T07:10+02'' AND t_departure <= ''2022-08-09T07:30+02'' | ||
AND date >= ''2022-08-08'' | ||
AND date <= ''2022-08-09'' | ||
WHERE t_departure >= '2022-08-09T07:10+02' AND t_departure <= '2022-08-09T07:30+02' | ||
AND date >= '2022-08-08' | ||
AND date <= '2022-08-09' | ||
ORDER BY t_departure | ||
LIMIT 100', | ||
7 | ||
); | ||
LIMIT 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM connections | ||
WHERE trip_id = ''168977951'' | ||
AND date > ''2022-08-08'' AND date <= ''2022-08-09''' | ||
); | ||
WHERE trip_id = '168977951' | ||
AND date > '2022-08-08' AND date <= '2022-08-09' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ set -x | |
|
||
psql -c 'VACUUM ANALYZE' | ||
|
||
psql -q -b --csv -f index.sql | ||
psql -q -b -v 'ON_ERROR_STOP=1' --csv -f index.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM stats_by_route_date | ||
WHERE route_id = ''17452_900'' -- M4 | ||
AND date >= ''2022-08-08'' AND date <= ''2022-08-14'' | ||
AND is_effective = true', | ||
10 | ||
); | ||
WHERE route_id = '17452_900' -- M4 | ||
AND date >= '2022-08-08' AND date <= '2022-08-14' | ||
AND is_effective = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
SELECT * from bench( | ||
'SELECT * | ||
SELECT * | ||
FROM stops | ||
ORDER BY ST_Distance(stop_loc::geometry, ST_SetSRID(ST_MakePoint(9.7, 50.547), 4326)) ASC | ||
LIMIT 100' | ||
); | ||
LIMIT 100 |