You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the aws_pricing_product table, sometimes we want to get prices for specific resources based on ID, name, etc., so we try to run a query like:
with volume_list as (
select
region,
volume_type
from
aws_ebs_volume
)
select
p.price_per_unit,
p.filters
from
volume_list as v
left join aws_pricing_product as p on
p.service_code = 'AmazonEC2'
and p.filters = jsonb_object(ARRAY['regionCode', v.region]::TEXT[])::text ::jsonb
and p.attributes ->> 'volumeApiName' = v.volume_type
The query runs and doesn't seem to ever finish.
The query plan looks a bit strange:
> explain with volume_list as (
select
region,
volume_type
from
aws_ebs_volume
)
select
p.price_per_unit,
p.filters
from
volume_list as v
left join aws_pricing_product as p on
p.service_code = 'AmazonEC2'
and p.filters = jsonb_object(ARRAY['regionCode', v.region]::TEXT[])::text ::jsonb
and p.attributes ->> 'volumeApiName' = v.volume_type
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| QUERY PLAN |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Nested Loop Left Join (cost=0.00..20000400010000.00 rows=25000000 width=64) |
| -> Foreign Scan on aws_ebs_volume (cost=0.00..20000000000000.00 rows=1000000 width=200) |
| -> Foreign Scan on aws_pricing_product p (cost=0.00..400.00 rows=1 width=400) |
| Filter: ((service_code = 'AmazonEC2'::text) AND (service_code = 'AmazonEC2'::text) AND ((attributes ->> 'volumeApiName'::text) = aws_ebs_volume.volume_type)) |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
The text was updated successfully, but these errors were encountered:
For the
aws_pricing_product
table, sometimes we want to get prices for specific resources based on ID, name, etc., so we try to run a query like:The query runs and doesn't seem to ever finish.
The query plan looks a bit strange:
The text was updated successfully, but these errors were encountered: