ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?

Moderator: NorbertKrupa

Post Reply
beth
Intermediate
Intermediate
Posts: 58
Joined: Tue Oct 01, 2013 12:42 pm

ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?

Post by beth » Thu Oct 29, 2015 3:22 pm

Good morning,

The ANALYZE_EXTERNAL_ROW_COUNT calculates the exact number of rows in an external table.

Where does it store these row counts?
'

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?

Post by NorbertKrupa » Thu Oct 29, 2015 6:40 pm

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.

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?

Post by JimKnicely » Wed Nov 04, 2015 8:20 pm

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

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: ANALYZE_EXTERNAL_ROW_COUNT - Where's the counts?

Post by NorbertKrupa » Thu Nov 05, 2015 5:14 am

JimKnicely wrote:I believe the row counts are stored in v_internal.vs_tables
Nice find, Jim. I hope this gets into the documentation!
Checkout vertica.tips for more Vertica resources.

Post Reply

Return to “New to Vertica Database Administration”