Good morning,
The ANALYZE_EXTERNAL_ROW_COUNT calculates the exact number of rows in an external table.
Where does it store these row counts?
'
ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?
Moderator: NorbertKrupa
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?
In a dark place (probably catalog; not 100% sure). You should be able to export them using export_statistics.
Checkout vertica.tips for more Vertica resources.
- JimKnicely
- Site Admin
- Posts: 1825
- Joined: Sat Jan 21, 2012 4:58 am
- Contact:
Re: ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?
I believe the row counts are stored in v_internal.vs_tables:
Code: Select all
dbadmin=> CREATE external TABLE test
dbadmin-> (
dbadmin(> c1 INT,
dbadmin(> )
dbadmin-> As Copy from 'webhdfs://testserver1:50070/apps/hive/warehouse/admin.db/test_orc_tst/*' On any node ORC;
CREATE TABLE
dbadmin=> SELECT name, rowcount FROM v_internal.vs_tables WHERE name = 'test';
name | rowcount
------+----------
test | -1
(1 row)
dbadmin=> select analyze_external_row_count('test');
analyze_external_row_count
----------------------------
0
(1 row)
dbadmin=> SELECT name, rowcount FROM v_internal.vs_tables WHERE name = 'test';
name | rowcount
------+----------
test | 1305
(1 row)
Jim Knicely
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.
-
- GURU
- Posts: 527
- Joined: Tue Oct 22, 2013 9:36 pm
- Location: Chicago, IL
- Contact:
Re: ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?
Nice find, Jim. I hope this gets into the documentation!JimKnicely wrote:I believe the row counts are stored in v_internal.vs_tables
Checkout vertica.tips for more Vertica resources.