0

This article on Livedocs says you should add the database name in front of tables.
http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7d47.html

My question is, should I do that everywhere where a table name appears or only once?
In this query:
select T1.col,T2.col from T1 left join T2 on T1.id=T2.id order by T2.order;

Should I add main.T1 and main.T2 everywhere or just after for, the first time:
select T1.col,T2.col from main.T1 left join main.T2 on T1.id=T2.id order by T2.order;

Thank you.

Francisc
  • 77,430
  • 63
  • 180
  • 276
  • This sounds like super micro optimizations, I would just avoid it. – Andreas Sep 18 '11 at 12:55
  • If it's mentioned on that page it's probably worth it, especially on a mobile device. They say AIR will look for available databases then pick `main`. One query less sounds good to me. – Francisc Sep 18 '11 at 20:06

1 Answers1

1

Based on a reading of the documentation you cited, I'd say it advises you to use the database name in the FROM clause only:

Always explicitly specify database names along with table names in a statement. (Use “main” if it’s the main database). For example, use SELECT employeeId FROM main.employees rather than SELECT employeeId FROM employees. Explicitly specifying the database name prevents the runtime from having to check each database to find the matching table.

[emphasis added]

Tim
  • 5,371
  • 3
  • 32
  • 41
  • Yeah, but that's a simplistic example. If I have joins, and need to specify `table.column` before select do I use main there as well? How about in join statements when a table name can be used multiple times? I hate unclear documentation... – Francisc Sep 25 '11 at 18:10