Extremely Slow ST_Contains Query Across 20 Billion Rows in Vertica Place
Hello,
I have a table with about 20 Billion rows in Vertica Place. Each row has a point(long, lat) and a property value.
I need to find all points that fall within a small rectangle (long1 lat1, long 2 lat 2).
I converted the point column in the table to a geometry type, and then I am trying to run an ST_Contains query.
Essentially:
select * from table_a where ST_Contains(ST_GeomFromText('Polygon(long1, lat1, long2, lat2.......)), pointColumnInTable_A_of_geometrytype)
This query seemed pretty fast on a few hundred million rows, but then seems to have slowed down considerably as the rows in the table increased.
I want to understand if there's a way to speed-up the query to deal with 20Billion rows? Would some kind of indexing help? I'd appreciate any pointers.
One possibility might be to split the table and then query in appropriate table, but ideally I wouldn't want to do that. I'd imagine Vertica Place would have a way to take care of this problem.
Thanks.
I have a table with about 20 Billion rows in Vertica Place. Each row has a point(long, lat) and a property value.
I need to find all points that fall within a small rectangle (long1 lat1, long 2 lat 2).
I converted the point column in the table to a geometry type, and then I am trying to run an ST_Contains query.
Essentially:
select * from table_a where ST_Contains(ST_GeomFromText('Polygon(long1, lat1, long2, lat2.......)), pointColumnInTable_A_of_geometrytype)
This query seemed pretty fast on a few hundred million rows, but then seems to have slowed down considerably as the rows in the table increased.
I want to understand if there's a way to speed-up the query to deal with 20Billion rows? Would some kind of indexing help? I'd appreciate any pointers.
One possibility might be to split the table and then query in appropriate table, but ideally I wouldn't want to do that. I'd imagine Vertica Place would have a way to take care of this problem.
Thanks.
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.