Posts

Showing posts from September, 2023

Postgresql index space for some table unreal big / PostgreSQL - Size of Indexes

PostgreSQL - Size of Indexes WITH RECURSIVE pg_inherit(inhrelid, inhparent) AS (select inhrelid, inhparent FROM pg_inherits UNION SELECT child.inhrelid, parent.inhparent FROM pg_inherit child, pg_inherits parent WHERE child.inhparent = parent.inhrelid), pg_inherit_short AS (SELECT * FROM pg_inherit WHERE inhparent NOT IN (SELECT inhrelid FROM pg_inherit)) SELECT table_schema , TABLE_NAME , row_estimate , pg_size_pretty(total_bytes) AS total , pg_size_pretty(index_bytes) AS INDEX , pg_size_pretty(toast_bytes) AS toast , pg_size_pretty(table_bytes) AS TABLE FROM ( SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM ( SELECT c.oid , nspname AS table_schema , relname AS TABLE_NAME , SUM(c.reltuples) OVER (partition BY parent) AS row_estimate , SUM(pg_total_relation_size(c.oid)) OVER (partition BY parent) AS total_bytes , SUM(pg_i

Tailwind / Css flexbox: limit height of child scrollable element based on small sibling

Image
Presenting a css approach to crafting a vertically scrollable list, this method leverages the power of flexbox to seamlessly adapt to the space allocated by a neighboring element. Both a  pure CSS  rendition and a  Tailwind CSS  variation are at your disposal. Use Case: Our specific requirement called for the creation of a container featuring two distinct columns: The left-hand column needed to accommodate a chart area that could expand as needed. The right-hand column had to house a list that scrolled vertically and utilized the entire available height. Requirements: Our key requirements were as follows: The chart area should have the capacity to hold an canvas element. The scrollable list should adapt its height based on the chart area’s dimensions, displaying as many items as possible within that space while providing vertical scrolling when necessary. Challenges: We encountered a challenge when applying flexbox alongside the overflow: scroll property and rendering the list of items