insert into table - Mailing list pgsql-admin

From Yambu
Subject insert into table
Date
Msg-id CALhHtcAEh82EYxvHVenoaCySidM7UM1Jnm0p1WQr7hgROtjpXA@mail.gmail.com
Whole thread Raw
Responses Re: insert into table
Re: insert into table
List pgsql-admin
hi

may i know why the below mysql is not inserting into table analyze_checks



insert into analyze_checks(dbname,table_name,frag_ratio, days,needs_optimization,needs_analyzing )
(select
'test' as dbname,
table_name,
frag_ratio,
days,
needs_optimization,
needs_analyzing
from
(select
table_name,
cast(frag_ratio as decimal(5,2)) as frag_ratio,
days,
case when frag_ratio > 1 then 'Yes' else 'No' end as needs_optimization,
case when days > -1 then 'Yes' else 'No' end as needs_analyzing
from (
select
t.ENGINE,
concat(t.TABLE_SCHEMA, '.', t.TABLE_NAME) as table_name,
round(t.DATA_FREE/1024/1024, 2) as data_free,
(t.data_free/(t.index_length+t.data_length)) as frag_ratio,
datediff(now(), last_update) as days
FROM information_schema.tables t
left join mysql.innodb_table_stats s on t.table_name=s.table_name
WHERE DATA_FREE > 0 ORDER BY frag_ratio DESC )d ) d
where needs_optimization='Yes' or needs_analyzing='Yes');

pgsql-admin by date:

Previous
From: Nikhil Shetty
Date:
Subject: Re: Upgrading password encryption from md5 to scram-sh-256
Next
From: Scott Ribe
Date:
Subject: Re: insert into table