Query Performance : Data Table VS Stream
Hi,
I have question about the query performance for Data Table and Stream.
In PostgreSQL, the Data Table and Stream has the following table structure:
| DataTable | Stream | |
| Columns | entry_id|entity_id|entity_key|source_id|source_type|tags|time|field_values|full_text|location | entry_id|entity_id|source_id|source_type|tags|time|field_values|full_text|location |
| Index | entity_key field_values |
(entity_id, time) entity_id |
| Constraints | entry_id (entity_id, entity_key) |
(entity_id,source_id,time,source_type) |
According to the comparing above , the questions are :
- According to the offical document , for the Data Table, "Anything greater than 100,000 rows will gradually begin to cause queries to perform slower". Is it same for Stream ?
- The Data Table has index on field_values while Stream doesn't , Does it means the query performance on the field of Data Shape for data table should be much faster than Stream using JDBC query as long as not querying on time field ? Does QueryDataTableEntries has the better performance than QueryStreamEntriesWithData as well in this case ?
- If always query on the index field , will query Data Table still become slow after storing more than 100,000 records ?
- Why not add field_values to index for Stream ? to avoid the increased data volume ?
Regards,
Sean

