Closed Marczeeee closed 8 years ago
It looks like you have some columns which don't have an n_distinct entry.
What does the following query returns on the related database ?
SELECT n.nspname,c.relname, a.attname, t.typname, s.*
FROM pg_class c
JOIN pg_namespace n ON c.relnamespace = n.oid
JOIN pg_attribute a ON a.attrelid = c.oid
JOIN pg_type t ON a.atttypid = t.oid
LEFT JOIN pg_statistic s ON s.starelid = c.oid AND s.staattnum = a.attnum
WHERE s.stadistinct is NULL
AND nspname NOT IN ('information_schema','pg_catalog','pg_toast') AND attnum > 0;
As a quick workaround, an "ANALYZE tablename" for the tables involved in the index suggestion should resolve the issue, until we fix this case and release a new version of powa-web.
The given query returned a pretty long resultset (1020 entries). Using ANALYZE seems to solve the problem as after running it the error is gone (and the resultset of the query contains only 770 entries). Thanks for your help!
The commit 11725f5518e42d07b0245524556d19d0587cc0f9 should solve this issue. I recommend you to wait a new release of powa-web, because there's currently a new feature (adding tabs on the query page) being implemented and it's not finished yet.
Thanks.
I installed Powa (3.0.0) with Powa-web, but when I open Query detail page sometimes (but not always) the Index suggestion widget doesn't load properly and the "An error occured while loading this widget" text displayed instead. On the console the following Python error is shown: