I try to execute a bat, and in this file i try to acceed to this variable :

$_SERVER['SERVER_NAME']

But it doesn't exist this index. In fact, when i try to print_r($_SERVER), there is no  SERVER_NAME index. There is a reason ? Is it because i launch this function in a bat ? 
Have I an other solution for get this variable ?

Thank you !


Question: Performance of SQL query with condition vs. without where clause
Answer: There are cases where a where clause on the primary key will be slower.

The simplest is a table with one row.  Using the index requires loading both the index and the data page -- two reads.  No index cuts the work in half.

That is a degenerate case, but it points to the issue -- the proportion of the rows selected.  Or, more accurately, the proportion of pages needed to resolve the query.

When the desired data is on all pages, then using an index slowed things down.  For a non primary key, this can be disastrous, when the table is bigger than the page cache and the accesses are random.

Since pages are ordered by a primary key, the worst case is an additional index scan -- not too bad.

Some databases use statistics on tables to decide when to use an index and when to do a full table scan.  Some don't.

In short, for low selectivity queries, an index will improve performance.  For high selectivity queries, using an index can result in marginally worse performance or dire performance, depending on various factors.