Created
September 24, 2026 11:44
-
-
Save esgn/a7438214657fec49e5cf1da4e9a37a47 to your computer and use it in GitHub Desktop.
Test influence nombre threads sur geoparquet GPF
This file contains hidden or 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
| -- Activation des logs HTTP | |
| SET logging_storage = 'memory'; | |
| CALL enable_logging( | |
| 'HTTP', | |
| storage = 'memory', | |
| storage_buffer_size = 0 | |
| ); | |
| -- On affiche le nombre de threads pour contrôle | |
| SELECT current_setting('threads') AS threads; | |
| -- La requête | |
| select min(altitude_maximale_sol), max(altitude_maximale_sol) from 'https://data.geopf.fr/chunk/telechargement/download/BDTOPO_PQT/BDTOPO_TOUSTHEMES_3-5_GEOPARQUET_WGS84G_FRA_2026-06-15/batiment.parquet'; | |
| -- Stats HTTP | |
| WITH requests AS ( | |
| SELECT | |
| request.start_time AS ts, | |
| request.duration_ms AS duration_ms, | |
| response.status AS status | |
| FROM duckdb_logs_parsed('HTTP') | |
| WHERE request.type = 'GET' | |
| ), | |
| rps AS ( | |
| SELECT | |
| ts, | |
| count(*) OVER ( | |
| ORDER BY ts | |
| RANGE BETWEEN INTERVAL '1 second' PRECEDING | |
| AND CURRENT ROW | |
| ) AS rps | |
| FROM requests | |
| ), | |
| stats AS ( | |
| SELECT | |
| count(*) AS n_get, | |
| round(avg(duration_ms), 1) AS avg_ms, | |
| min(duration_ms) AS min_ms, | |
| quantile_cont(duration_ms, 0.50) AS p50_ms, | |
| quantile_cont(duration_ms, 0.95) AS p95_ms, | |
| max(duration_ms) AS max_ms, | |
| count(*) FILTER ( | |
| WHERE status = 'INVALID' | |
| ) AS timeouts | |
| FROM requests | |
| ) | |
| SELECT | |
| current_setting('threads') AS threads, | |
| stats.n_get, | |
| stats.avg_ms, | |
| stats.min_ms, | |
| stats.p50_ms, | |
| stats.p95_ms, | |
| stats.max_ms, | |
| stats.timeouts, | |
| max(rps.rps) AS max_rps | |
| FROM stats | |
| CROSS JOIN rps | |
| GROUP BY ALL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment