CREATE OR REPLACE VIEW optimized_sitemap AS WITH sitemap_data AS ( SELECT p.url::TEXT AS url FROM optimized_posts p UNION ALL SELECT b.url::TEXT AS url FROM optimized_books b UNION ALL SELECT m.url::TEXT AS url FROM optimized_movies m UNION ALL SELECT ar.url::TEXT AS url FROM optimized_artists ar UNION ALL SELECT g.url::TEXT AS url FROM optimized_genres g UNION ALL SELECT s.url::TEXT AS url FROM optimized_shows s UNION ALL SELECT pa.permalink::TEXT AS url FROM optimized_pages pa UNION ALL SELECT ss.slug AS url FROM static_slugs ss ) SELECT url FROM sitemap_data;