Created
June 26, 2014 20:22
-
-
Save tayl0r/66299f41f530c8c881c5 to your computer and use it in GitHub Desktop.
redshift wtf explain plan
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
10 second query: | |
XN Merge (cost=1000000000000.07..1000000000000.07 rows=1 width=76) | |
-> XN Network (cost=1000000000000.07..1000000000000.07 rows=1 width=76) | |
-> XN Sort (cost=1000000000000.07..1000000000000.07 rows=1 width=76) | |
-> XN HashAggregate (cost=0.05..0.06 rows=1 width=76) | |
-> XN Subquery Scan volt_dt_0 (cost=0.04..0.05 rows=1 width=76) | |
-> XN HashAggregate (cost=0.04..0.04 rows=1 width=76) | |
-> XN Subquery Scan derived_table1 (cost=0.02..0.03 rows=1 width=76) | |
-> XN HashAggregate (cost=0.02..0.02 rows=1 width=44) | |
-> XN Seq Scan on user_events (cost=0.00..0.01 rows=1 width=44) | |
09 minute query: | |
XN Merge (cost=1000000000000.13..1000000000000.14 rows=1 width=76) | |
-> XN Network (cost=1000000000000.13..1000000000000.14 rows=1 width=76) | |
-> XN Sort (cost=1000000000000.13..1000000000000.14 rows=1 width=76) | |
-> XN HashAggregate (cost=0.12..0.12 rows=1 width=76) | |
-> XN Subquery Scan volt_dt_0 (cost=0.10..0.11 rows=1 width=76) | |
-> XN HashAggregate (cost=0.10..0.10 rows=1 width=76) | |
-> XN Subquery Scan derived_table1 (cost=0.09..0.10 rows=1 width=76) | |
-> XN HashAggregate (cost=0.09..0.09 rows=1 width=44) | |
-> XN Seq Scan on user_events (cost=0.00..0.08 rows=1 width=44) | |
identical explain plans with the exception of "cost". | |
fast = XN Seq Scan on user_events (cost=0.00..0.01 rows=1 width=44) | |
slow = XN Seq Scan on user_events (cost=0.00..0.08 rows=1 width=44) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What are the SQL queries? What are the data types? I experienced much faster hashing of integers compared to varchar.