[Feature Request] SQL Views "data" tab: show number of rows (like it is done for tables)

apric's profile image apric posted 8 years ago in Feature discussion Permalink

There is no indication whatsoever how many results are displayed (or available in total) when opening an SQL view "data" tab.

Expected (similar to viewing table "data" tab):

$name: x rows total, y rows match to filter
ansgar's profile image ansgar posted 8 years ago Permalink

What about the popup on the result tabs, saying "X columns x Y rows"?

kalvaro's profile image kalvaro posted 8 years ago Permalink

I suspect the root problem is that MySQL provides a row count for tables (even if it's approximate for InnoDB) but not for views. That piece of data, although helpful, would imply changing this:

SELECT * FROM `test`.`foo_view` LIMIT 1000;

... into this:

SELECT SQL_CALC_FOUND_ROWS * FROM `test`.`foo_view` LIMIT 1000;
SELECT FOUND_ROWS();

This can kill performance if the view is expensive to compute (something there's no way to know in advance).

However, perhaps it could be useful to tweak current message and at least display the number of columns shown:

test.foo_view: limited to 1,000

This would at least solve the OPs problem for small result-sets and wouldn't be expensive regarding performance.

apric's profile image apric posted 8 years ago Permalink

When viewing the "data" tab for an SQL view, we are already looking at result rows in the grid. The grid knows how many rows it is showing.

My suggestion was to show at least this visible row count in the grid instead of having to count the visible rows myself.

Please login to leave a reply, or register at first.