0 votes
493 views
Dear whom it may concern, I have excuted a simple query as shown below to search time-series data from NSC DR2 and DR1 by using TOPCAT. However, the query doesn't return any result for more than 12 hours. Is there any wrong with my query or the server? Thanks very much~ (the query: select * from nsc_dr1.meas where abs(ra-6.582959)<=0.00027778 and abs(dec+72.794643)<=0.00027778)
by | 493 views

1 Answer

0 votes
Hi,

thank you for your question.

This query will not use the indexes on ra and dec.  So it will be a full table scan of the billions of rows instead.

When you put a function around the indexed column (abs(ra-6.582959)), it has to calculate that expression for every row.

Try changing the query to not using the ABS function on the indexed columns.
by ascottdemo (1.3k points)
edited by 1056
select * from nsc_dr1.meas where ra <= 6.582959+0.0002778  and ra >= 6.582959 - .00027778 and
dec <= 72.794643+0.00027778 and dec >= 72.794643-0.00027778;
I see. Thanks very much for your reply~

449 questions

463 answers

473 comments

658 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories