performance charts: fix sql error