mysql view with fulltext index [closed] - mysql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need to create mysql view with fulltext index. Are there way to create view in mysql with fulltext index.
Like table altering can I alter view to add full text index??
ALTER TABLE news ADD FULLTEXT(headline, story);

From the manual:
D.5 Restrictions on Views
View processing is not optimized:
It is not possible to create an index on a view.
Indexes can be used for views processed using the merge algorithm. However, a view that is processed with the temptable algorithm is unable to take advantage of indexes on its underlying tables (although indexes can be used during generation of the temporary tables).

Related

Howto efficiently search a huge mysql table [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
if I had a mysql table that has, lets say 300 million rows, how would I search for a row using
SELECT id WHERE coloumn = "abc" ;
most efficiently? Can I prepare the data so it would help the sql searching through the data? Or does it parse the rows row by row?
The SQL 101 answer here is an index using CREATE INDEX:
CREATE INDEX column_index ON table_name (`column_name`)
This of course depends on your schema. You can index more than one column as well and can apply UNIQUE constraints to ensure that each value is used only once.
On large tables the CREATE INDEX operation will be brutally slow to create the first time, so schedule some downtime if necessary. Once created it will be kept up-to-date automatically.

Storing user data (settings) in separate table to speed up user search [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
If a web application has to search many IDs to find a matching on, but doesn't need any user data until the correct one has been found, would it be optimal to store the user data fields in a separate table and use the Accounts table (which contains user ID, password hash, etc.) for searches?
Create a clustered index on your unique ID field which will determine the physical ordering of data and it will speed up the searches and then you can extract only the required rows.
You can also create a non clustered index and then make it point to the primary key.

MYSQL unique VS php SELECT then insert.. Which is faster? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Which is faster If I want to maintain a unique field in a table
Running a select query then insert query
OR directly running an insert query but have a unique field in the table instead
If you want to maintain a unique column in a database, then use the database mechanisms for that. Create a unique index or unique constraint on the column. Work with the database, not against it.
Furthermore, there is a major issue with your first approach. You are introducing a race condition. Two processes could attempt to insert the same record at the same time. They would both look at the values in the table and both would see that the insert is okay. And then both would insert the same value, creating a duplicate.
Of course, there are work-arounds for this, generally involving transactional logic or locking the tables. Both of these introduce additional overhead, which slows down performance.
Just create a unique column and don't worry about the uniqueness -- the database does the worrying for you.

Is there a way to make a VIEW statement in MS Access? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I had a table named table1 and have a three column.. column1, column2,column3..
I want to view the value of my columns in table using VIEW statement not SELECT is it possible?
Thank in advance#
No. View is a SQL database concept. You will have to use SELECT... to create a query, which is essentially the same thing. MSAccess has no concept of Views, it uses Queries.
A view is an SQL query that has been given a name and stored in the database. That is exactly what the Access queries are.

How to add Btree or hash index to a table in mysql? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have two tables and two queries on those tables. I am using SQL workbench to query these tables. Can someone tell me the syntax of adding BTREE or HASH index to these tables?
CREATE INDEX supports USING BTREE or USING HASH on the end.
http://dev.mysql.com/doc/refman/5.0/en/create-index.html