explain-pushdown.td 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. $ set-regex match=(\d+) replacement=<number>
  10. $ postgres-execute connection=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}
  11. ALTER SYSTEM SET enable_explain_pushdown = true
  12. > CREATE CLUSTER sources (SIZE '1', REPLICATION FACTOR 0);
  13. > CREATE SOURCE counter IN CLUSTER sources FROM LOAD GENERATOR COUNTER (UP TO 100);
  14. # We expect the explain to time out, so no point waiting for very long...
  15. $ set-sql-timeout duration=5s force=true
  16. ! EXPLAIN FILTER PUSHDOWN FOR SELECT count(*) FROM counter WHERE counter = 1;
  17. timeout
  18. $ set-sql-timeout duration=default force=true
  19. # Check that we can still handle normal queries
  20. > SELECT 1 + 1;
  21. <number>
  22. # If we scale the source cluster up, our query should eventually complete
  23. > ALTER CLUSTER sources SET (REPLICATION FACTOR 1);
  24. > EXPLAIN FILTER PUSHDOWN FOR SELECT count(*) FROM counter WHERE counter = 1;
  25. materialize.public.counter <number> <number> <number> <number>